What is a good language to work with arbitrary length integers? [closed]
-
15-04-2021 - |
Question
I want to factorise integers, for example
41748850938502584251
I want to factorise this using brute-force. Given the short length of this number this should be possible.
What's a suitable programming language which supports an integer data type that has arbitrary length?
Solution
Scheme has a featureful numeric tower that provides, among other things, arbitrary precision integers (see sec. 3.4 of R6RS which requires this of conforming implementations).
OTHER TIPS
You could use Perl. Put
use bigint;
at the beginning of your program.
Java's BigInteger class handles very large numbers: http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
Haskell has the Integer data type for unlimited integers. Likewise Frege (it uses Javas big integers).