RLaB is designed for mathematical calculations so let's do some. The four
basic arithmetic operators have symbols +, -, *, /
representing
addition, subtraction, multiplication, and division respectively. Now enter
some one line expressions as shown here:
> 2*4 8 > 1/2 0.5 > 1+11 12 > 1-11 -10 > 1*2/3+4-5 -0.333 > 1/0 inf > 0/(1/0) 0 > 0/0 NaN
The 5th expression illustrates compliance with the usual operator
hierarchy and then we observe that RLaB can handle
exceptions3 such as when ∞ (inf
) is a result or an input to
further calculation; and also ``not-a-number'' (NaN
). RLaB can use
complex numbers as well as real numbers so now try
> 1/1i 0 - 1i > 1/1i + 1/1j 0 - 2i > 1/1i * 1/1j -1 > 1/1i/1j -1
where we see that i or j can represent the complex
number . No four function calculator is complete without a
memory so now we look at how to store results in a variable.