REM
REM Demonstration on how to use the GMP extension.
REM

INCLUDE "gmp.bac"

PRINT NL$, "The factorial number of 40 is: ", FACTORIAL$("40")
PRINT "Press a key to continue..."

k = GETKEY

PRINT NL$, "Element 80 in the Fibonacci sequence is: ", FIBONACCI$("80")
PRINT "Press a key to continue..."

k = GETKEY

PRINT NL$, "Now adding two numbers 123456789123456789 and 987654321987654321: ";
PRINT ADD$("123456789123456789", "987654321987654321")
PRINT "Press a key to continue..."

k = GETKEY

PRINT NL$, "Calculating the modulo of 123454323221 and 1136789789: ";
PRINT MODULO$("123454323221", "1136789789")
PRINT "Press a key to continue..."

k = GETKEY

PRINT NL$, "Check if 1 is a prime number: ";
PRINT ISPRIME("1", 5)
PRINT