manual:chapter3:reals

This is an old revision of the document!



A number in newRPL is represented as exact or approximate. To enter a number as approximate use a trailing dot. To enter a number as exact omit any trailing dot. For routine arithmetic this distinction doesn't matter much, but it does come into play when evaluating symbolic expressions.

Here are some examples:

Approximate Numbers Exact Numbers
1. 1
1.007. 1.007
1.007.e-10 1.007e-10

Arithmetic performed on numbers takes into account the operands (exact or approximate) and results are displayed accordingly.

For example, 1 3 / results in 0.333. (approximate), whereas 1 2 / results in 0.5 (exact).


Numbers in different bases can be entered by preceeding the value with a # and a trailing letter to indicate the base (b = binary, o = octal, d = decimal, h = hex, note that the trailing letter is case insensitive). Arithmetic can be done on numbers in different bases with the result displayed as the base of the first argument. Only exact numbers in the range $-2^{63}$ to $2^{63}-1$ can be expressed in multiple bases. Outside this range (or approximate numbers) will be switched to decimal.

Here are example arithmetic operations in bases other than 10:

#1101b #FFh + yields 100001100b

256 #FFFFh + yields 65,791

#355o #11010101b x yields #142461o

#7h 2 / yields 3.5

#2h 63 Y^X yields 9.223372E18


  • manual/chapter3/reals.1497227535.txt.gz
  • Last modified: 2017/06/11 17:32
  • by smartin