Name | Description | Example and Notes |
---|
+ – * / ( ) | Arithmetic operations and brackets | 2*3+4/(5-1) → 7 |
---|
abs | the absolute value (positive size) | abs(-3.9) → 3.9 abs(3.9) → 3.9 |
---|
acos | arc cosine, the angle for a given cosine | acos(0.5) → 1.0471975511965979 acos(0.5)/Pi*180 → 60.00000000000001 (degrees) |
---|
asin | arc sine, the angle for a given sine | asin(sqrt(3)/2)/Pi*180 → 60 (degrees) |
---|
atan | arc tangent, the angle A for a given tangent -π/2 ≤ A ≤ π/2 | 4 * atan(1) → 3.141592653589793 which is π |
---|
atan2 | ang2(y,x) is the anticlockwise angle A at (0,0) between the x>0 axis and the point(x,y) -π ≤ A ≤ π | atan2(1,-1)/Pi*180 → 135 (degrees) |
---|
ceil | round up to the nearest integer | ceil(-3.9) → -3, ceil(-3.1) → -3 ceil(3.1) → 4, ceil(3.9) → 4 |
---|
cos | cosine of an angle (in radians) | cos(60*Pi/180) → 0.5000000000000001 cos(Pi) → -1 |
---|
E | e | E → 2.718281828459045 |
---|
exp | exp(p) means e to the power of p | exp(1) → 2.718281828459045 |
---|
floor | round down to the nearest integer | floor(-3.9) → -4, floor(-3.1) → -4 floor(3.1) → 3, floor(3.9) → 3 |
---|
log | log to base e logb(x) is log(x)/log(b) | log(E) → 1 log(sqrt(E)) → 0.5 log(3)/log(2) → 1.584962500721156 is log2(3) |
---|
Phi | golden section Φ=(√5 + 1)/2 | Phi → 1.618033988749895 |
---|
phi | golden section φ=(√5 – 1)/2 | phi → 0.6180339887498949 |
---|
Pi, pi | π | Pi → 3.141592653589793 |
---|
pow | pow(x,p) means xp | pow(2,3) → 8 pow(3,2) → 9 pow(2,log(3)/log(2)) → 3 |
---|
random | a random number between 0 and 1 | random() → 0.8027669817931609 random() → 0.8921109901820881 |
---|
round | round to the nearest integer | round(-3.9) → -4, round(-3.1) → -3 round(3.9) → 4, round(3.1) → 3 |
---|
sin | sine of an angle (in radians) | sin(Pi/2) → 1 |
---|
sqrt | square root √ | sqrt(2) → 1.4142135623730951 |
---|
tan | tangent of an angle (in radians) | tan(Pi/4) → 0.9999999999999999 |
---|
> >= < <= == != | comparisons between two values, gives true or false use in the Conditional part of (?:) expressions | Pi>2 → true cos(Pi/3)==0.5 → false but should be true This is caused by rounding in the final computed digit Better is: abs(cos(Pi/3)-0.5)<0.0000001 → true |
---|
( expr ? t : f) | conditional expression; if expr is true then t is evaluated as the result, if false then f is evaluated as the result | (sqrt(10)>=3 ? 4 : 3) → 4 |
---|
fib, Fib or F | Fib(n) is the n-th Fibonacci number | F(10) → 55, Fib(-5) → 5 |
---|
luc, Luc or L | Luc(n) is the n-th Lucas number | L(10) → 123, Luc(0) → 2 |
---|
G | G(a,b,n) is the n-th General Fibonacci number where G(a,b,0)=a,G(a,b,1)=b | G(3,1,5) → 14, G(1,3,-4) → -4 |
---|