June 2019
Intermediate to advanced
218 pages
5h 19m
English
As we saw in the previous section, if you know your program needs to operate on large integers beyond the range of Int32 or Int64, there are various options in Julia. First, if your numbers can still be bounded, there is Int128. However, for arbitrarily large integers, Julia has built-in support via the BigInt type. Run the following code to see the difference from the normal bounded integers (and compare the results to the previous section where we added the large integers.):
julia> big(9223372036854775806) + 1 + 19223372036854775808 julia> big(2)^6418446744073709551616
Operations on Int128 are similar in performance, while for BigInt types they are much slower than for the basic integers. In the following code, we measure the time ...
Read now
Unlock full access