Understanding BigInt

#1

Playing aroudn with types yesterday I found typemax(BigInt) does not exist. Which makes perfect sense. the Julia documentation on Arbitrary Precision Arithmetic refers to the Gnu GMP.
Would this be the best place to read up on BigInt?

0 Likes

#2

Depends on what you want to know about BigInt. GMP says they go up to arbitrary size, but in reality they’re limited by the number of bits for one BigInt (they save the size as something equivalent to an int32_t representing the number of bits in one BigInt…). For most practical applications this is enough though.

0 Likes

#3

Thanks :slight_smile: I am just interested in how this is stored. Nothing I desperately need to know!

0 Likes

#4

Gotcha - you’re most likely to find information about this in the GMP documentation. As far as I know, they’re using custom memory management in C to avoid repeated and unnecessary allocations. You shouldn’t worry about it in general though.

1 Like