[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bigint support



Preliminary bigint support using the GNU MP library is now in. It's not 
compiled into the image by default at the moment, to try it out, grab a 
copy of GOO off CVS, add "(use goo/bignum/gmp)" to src/goo.goo, and 
rebuild GOO. There is transparent switchover between <fixnum> and 
<bignum> depending on the size of the integer in the primitive numeric 
functions, so you generally shouldn't have to care about which kind of 
<int> you're dealing with.

It appears to work as far as I can tell but there are no testcases to 
ensure that, and bigint constants won't work in compiled code (as the 
compiler isn't smart enough to know not to emit "500000000000000000" in 
the C code). Constants do work in the evaluator, though, so you can do 
e.g.
goo/user 0<=  (* (pow 30 30) 5555555555555555555)
goo/user 0=> 
1143839622748049999885616037725195000000000000000000000000000000

Maybe next can be rational numbers and arbitrary precision floats.

james