Numbers

Numbers in Shen are positive, negative or zero and either whole or floating point. The negative number -3 is just written '-3'. Cancellation is used so that --3 is read as 3. Integer numbers are treated as a subclass of floating points so that 1 = 1.0 is true.

In Shen (- 3) is actually an application of two place subtraction to 3 and produces, not a number, but an object called a closure.

Shen includes /, *, + ,and *.

/ produces a float if the divisor is not a factor. Both * and + are polyadic; that is they take an arbitrary number of arguments.

The Shen standard maths library includes functions for trigonometry and for generating random numbers, and includes the functionality of the standard C++ maths library.

Shen versions 2.0 and greater will accept e notation; 6.0221418e23 is equivalent to 6.0221418×1023

Further Reading