An example of how to use arbitrary precision arithmetic (bignum) (bignums) in SL4A Scheme (Jan 2012) (Jscheme 7.2) on Android.
(import "java.math.BigInteger")
(define a (BigInteger. "999999999999999999999999999999")) ; Scheme strings are Java strings
(display (.multiply a a)) ; toString gets called implicitly
(newline)
(exit)
No comments :
Post a Comment