Yeah, I guess Rainbow doesn't bother with bignums. Jarc has exactly the same result, probably because they both use JVM longs. They both still let us use JVM bignums the long way though:
; This code will work on both Rainbow and Jarc.
(when (errsafe jarc.Jarc.class) use!rainbow)
(def big (x)
(java-static-invoke "java.math.BigInteger" 'valueOf x))
(def bigfact (x)
(if (< x 0) nil
(< 0 x) ((bigfact:- x 1) 'multiply big.x)
big.1))
Rainbow:
arc> (= foo bigfact.50)
30414093201713378043612608166064768844377641568960512000000000000
arc> type.foo
java-object
arc> foo!getClass
class java.math.BigInteger
Jarc:
Jarc> (= foo bigfact.50)
#java.math.BigInteger(743210128)
Jarc> foo!toString
"30414093201713378043612608166064768844377641568960512000000000000"
Jarc> type.foo
java.math.BigInteger
Jarc> foo!getClass
#class(java.math.BigInteger)