The supported operators, in order of precedence, are:
Precedence | Name | Evaluation Order | Symbol |
---|---|---|---|
15 | Parenthesis | n/a | ( … ) |
14 | Variable Resolution | n/a | … |
Property Access | left to right | … . … | |
Computed Property Access | … [ … ] | ||
Function Call | … ( … ) | ||
13 | Logical Not | right to left | ! … |
Bitwise Not | ~ … | ||
Unary Plus | + … | ||
Unary Minus | - … | ||
Typeof | typeof … | ||
Void | void … | ||
Delete | del … or delete … | ||
12 | Exponentiation | right to left | … ** … or … ^ … |
11 | Multiplication | left to right | … * … |
Division | … / … | ||
Modulus | … % … | ||
10 | Addition | left to right | … + … |
Subtraction | … - … | ||
9 | Bitwise Left Shift | left to right | … << … |
Bitwise Right Shift | … >> … | ||
8 | Greater Than | left to right | … > … |
Less Than | … < … | ||
Greater Than or Equal | … >= … | ||
Less Than or Equal | … <= … | ||
7 | Equality | left to right | … == … |
Inequality | … != … | ||
True Equality | … is … | ||
6 | Bitwise And | left to right | … & … |
5 | Bitwise Xor | left to right | … # … |
4 | Bitwise Or | left to right | … | … |
3 | Logical And | left to right | … && … |
2 | Logical Or | left to right | … || … |
1 | Assignment | right to left | … = … |
Variable | Value | Description |
---|---|---|
undefined, None | Variable for undefined, can also use void operator | |
null | Variable for null | |
true, True | Boolean true value | |
false, False | Boolean false value | |
nan, NaN | Numerical NaN value | |
inf, infinity, Infinity | Numerical Infinity value | |
i | Complex constant | |
w | Transfinite constant | |
pi | 3.141592653589793 | Ratio of a circle's circumference to its diameter. |
e | 2.718281828459045 | Common mathematical constant. |
deg | 0.017453292519943295 | Constant used to convert degree value to radians. |
rad | 57.29577951308232 | Constant used to convert radian value to degrees. |
phi | 1.618033988749895 | The Golden Ratio. |
sqrt2 | 1.4142135623730951 | The square root of 2. |
sqrt1_2 | 0.7071067811865476 | The square root of 0.5, or half of sqrt2. |
ln2 | 0.6931471805599453 | The natural logarythm of 2. |
ln10 | 2.302585092994046 | The natural logarythm of 10. |
Boolean
, Number
, BigInt
, BigNum
, String
, Array
, Object
, Function
, Complex
, Matrix
, and Surreal
create objects of their type.
globals()
- returns global namespace objectlocals()
- returns local namespace object
compileExpr(string)
- compile string as expression, and return runnable code objectevalExpr(obj)
- evaluate string or code object as expression, and return valuecompile(string)
- compile string as many expressions, and return runnable code objecteval(obj)
- evaluate string or code object as many expressions, and return value
repr(text)
- get text form of objectprint(text)
- print text to string
sign(number)
- return sign of numberabs(number)
- return absolute value of numbermax(*values)
- get maximum value from list of valuesmin(*values)
- get minimum value from list of valuesconstrain(number, max, min)
- constrains number between two valuesfloor(number)
- rounds number downceil(number)
- rounds number upround(number)
- rounds number to closest integertrunc(number)
- truncates decimal digits from numberhypot(*coords)
- gets distance to origin from coordsgcd(*values)
- calculates gcd of valueslcm(*values)
- calculates lcm of valueslerp(from, to, num)
- returns a number that is num of the way from "from" to "to"map(number, from, to, resfrom, resto)
- maps a number from a range of from - to to resfrom - restonorm(number, from, to)
- functions as map(number, from, to, 0, 1)
dist(x1, y1, x2, y2)
- gets the distance between two coordinates
random([[start], end])
- generates a random number, with optional start and end parametersrandint(start, end)
- generates a random integer between start and endrandintn(start, end)
- generates a random bigint between start and endrandgauss(mu, sigma)
- generates a random gaussian with mu and sigma parameters
sq(number)
- squares a numbercb(number)
- cubes a numbersqrt(number)
- gets the square root of a numbercbrt(number)
- gets the cube root of a numberexp(number)
- calculates e raised to the power of a numberpow(base, exponent)
- calculates base raised to the power of exponentroot(number, root)
- calculates nth root of a numberlog(number[, base])
- calculates the logarythm of a number, with an optional baselog10(number)
- calculates the base 10 logarythm of a numberlog2(number)
- calculates the base 2 logarythm of a numbertet(number, number)
- calculates the teteration of two numberssroot(number, number)
- calculates the super-root of two numbersslog(number, number)
- calculates the super-logarythm of two numbersfact(number)
- calculates the factorial of a number, decimals allowedgamma(number)
- the gamma function
degrees(number)
- converts number from radians to degreesradians(number)
- converts number from degrees to radians[sin, cos, tan](number)
- trigonometric functions[csc, sec, cot](number)
- reciprocal trigonometric functions[asin, acos, atan, atan2](number)
- inverse trigonometric functions[acsc, asec, acot](number)
- inverse reciprocal trigonometric functions[sinh, cosh, tanh](number)
- hyperbolic functions[csch, sech, coth](number)
- reciprocal hyperbolic functions[asinh, acosh, atanh](number)
- inverse hyperbolic functions[acsch, asech, acoth](number)
- inverse reciprocal hyperbolic functions
[[tohexstr, tooctstr, tobinstr, todecstr](number), tobasestr(number, base)]
- converts a number to a string in bases [16, 8, 2, 10, any][[fromhexstr, fromhexstrn, fromoctstr, fromoctstrn, frombinstr, frombinstrn, fromdecstr, fromdecstrn](number), [frombasestr, frombasestrn](number, base)]
- converts a number to a string in bases [16, 8, 2, 10, any], with an n suffix for bigints instead
Large Operation Protection: Off On |
Allow Complex Catculations: Off On |
Enable Enhanced Calculating Experience: Off On |
Realistic Mode: Off On |
Enable Settings Menu: Off On |