= #JxnPortable\docs\programmer_examples\UsingJavaAPI_5_BigInteger.jxn

a = @java.math.BigInteger("3")
 = 3 (java.math.BigInteger)

! #import java.math.BigInteger or
! #import java.math.* or
#import java.math
 = 7. added, View > PackageSearchList shows all (java.lang.String)

! now BigInteger is found without "java.math."
b = @BigInteger(7)  ! @BigInteger(int) works in JXN via auto toString
 = 7 (java.math.BigInteger)

! Automatic mapping to the arithmetic methods (multiply, subtract, ...) of java.math.BigInteger:
-a
 = -3 (java.math.BigInteger)
a b
 = 21 (java.math.BigInteger)
a - b
 = -4 (java.math.BigInteger)
a + b
 = 10 (java.math.BigInteger)
b / a
 = 2 (java.math.BigInteger)
b % a
 = 1 (java.math.BigInteger)
a^150
 = 369988485035126972924700782451696644186473100389722973815184405301748249 (java.math.BigInteger)

! Fibonacci numbers:
n = 1000
 = 1000 (int)
f0 = BigInteger.ZERO; f1 = BigInteger.ONE; JxnLoop.repeat( $this, "", n-1, "f2 = f1 + f0; f0 = f1; f1 = f2;" )
 = 43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875 (java.math.BigInteger)
$.doubleValue()
 = 4.3466557686937455E208 (double)

! but (mixed arithmetic with int not applicable for java.math.BigInteger because of missing public BigInteger(int) construtor):
a 2
? term: java.math.BigInteger * int not supported