Recent

Author Topic: Long integers  (Read 5347 times)

Borneq

  • Full Member
  • ***
  • Posts: 238
Long integers
« on: April 13, 2013, 12:25:07 am »
In FreePascal are additional types for large integer?
unsigned int64
signed and unsigned 128 bit
signed and unsigned 256 bit
?

Borneq

  • Full Member
  • ***
  • Posts: 238
Re: Long integers
« Reply #1 on: April 13, 2013, 12:30:04 am »
Only int64 and Qword.
128 and 256 bit must be a record - are any procedures to work with this long structures?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8402
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Long integers
« Reply #2 on: April 13, 2013, 05:35:11 am »
Quote
128 and 256 bit must be a record - are any procedures to work with this long structures?
None that I know of.

otorres

  • Jr. Member
  • **
  • Posts: 94
Re: Long integers
« Reply #3 on: April 13, 2013, 06:08:27 am »
Use TBCD object for big numbers, like 40 digits.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Long integers
« Reply #4 on: April 13, 2013, 08:10:47 am »
There is a binding to a math/big number library AFAIR, GMP or something like that. Maybe that covers 128 bit integers, don't know.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8402
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Long integers
« Reply #5 on: April 13, 2013, 03:42:38 pm »
Quote
There is a binding to a math/big number library AFAIR, GMP or something like that. Maybe that covers 128 bit integers, don't know.
No, that covers theoritically unlimited precision integers (up to memory limit) ;)

jollytall

  • Full Member
  • ***
  • Posts: 158
Re: Long integers
« Reply #6 on: November 24, 2021, 11:24:17 am »
I have just uploaded a unit with long integer support to github: https://github.com/zsoltszakaly/longmathforpascal.
If you need such a functionality, try it and let me know how it works.

 

TinyPortal © 2005-2018