Expressions and Operators
All the standard types of mathematical and logical expressions can
be formed in the Kenya language.
The following mathematical operators are available:
- +
- -
- * (multiply)
- / (divide)
- % (modulus)
- ^ (raise to the power)
- exp (exponentiation)
- log (natural log)
- sqrt (square root)
- sin
- cos
- tan
- asin
- acos
- atan
- random ( a random double between 0 and 1)
- round (to nearest integer)
- floor
- ceil
- abs (absolute value)
The following comparison operators are available:
- == (equality)
- != (not equal)
- <
- >
- <=
- >=
Logical expressions may be constructed from the following:
- && or 'and'
- || or 'or'
- ! or 'not'
- xor
- true
- false
- any comparative expression