Large Integer Support

Liberty BASIC has special support for large integers. Once a calculation produces an integer value greater than 32-bits in size it automatically coerces this numeric type to be a large integer which can be as large as needed until memory is exhausted.

Note: If you use a large integer in a computation involving floating point values or if you feed a large integer value into a function that performs its computation using a floating point mechanism it will be converted into a floating point format.

Examples:

  'Large integer calculations
  print 999999999999999999 + 1
  print 45 ^ 14
  print 100000000000001 mod 2

  'Coercion to floating point example
  a = 1230000000000001
  print a
  b = a / 3
  print b

  'Workaround for previous example
  a = 12300000000000001
  b = a - (a mod 3)
  c = b / 3
  print c

  'Example using trig function
  print tan(1234567000000000)
  print tan(1.234567e15)