I want to to perform computations with large integers in SML, through functions like pow in this link:
http://www.standardml.org/Basis/int-inf.html#IntInf:STR:SPEC
But how do I get to use this “library”?
UPDATE:
Thanks for the answer. I got it. I also had to change the limit for printing with
Control.Print.intinfDepth := 10000;
I made my own pow function for IntInfs (and it works) like this:
fun power 0 = IntInf.toLarge 1
| power n = IntInf.toLarge 2 * power(n-1);
It depends on which implementation you use, but generally you need to convert your Int’s to LageInt/InfInf types with the
Int.toLarge:The variable
aamay not be parsed in your interpreter. It depends on what you use. I have tested it in poly and mlton.where the above gets the types (given by mlton with -show-basis flag):