Overview

This is a calculator that has support for advanced operations such as bitwise operations, expression evaluation, and function evaluation. It is used like you would expect, just type in numbers and operations like you would on paper, then press enter.
Operators

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 … = …
Builtin Objects and Functions

Primitives and Numerical Constants

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.

Functions

Constructors

The functions Boolean, Number, BigInt, BigNum, String, Array, Object, Function, Complex, Matrix, and Surreal create objects of their type.

Namespace

globals() - returns global namespace object
locals() - returns local namespace object

Evaluation

compileExpr(string) - compile string as expression, and return runnable code object
evalExpr(obj) - evaluate string or code object as expression, and return value
compile(string) - compile string as many expressions, and return runnable code object
eval(obj) - evaluate string or code object as many expressions, and return value

Text

repr(text) - get text form of object
print(text) - print text to string

Simple Math

sign(number) - return sign of number
abs(number) - return absolute value of number
max(*values) - get maximum value from list of values
min(*values) - get minimum value from list of values
constrain(number, max, min) - constrains number between two values
floor(number) - rounds number down
ceil(number) - rounds number up
round(number) - rounds number to closest integer
trunc(number) - truncates decimal digits from number
hypot(*coords) - gets distance to origin from coords
gcd(*values) - calculates gcd of values
lcm(*values) - calculates lcm of values
lerp(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 - resto
norm(number, from, to) - functions as map(number, from, to, 0, 1) dist(x1, y1, x2, y2) - gets the distance between two coordinates

Random

random([[start], end]) - generates a random number, with optional start and end parameters
randint(start, end) - generates a random integer between start and end
randintn(start, end) - generates a random bigint between start and end
randgauss(mu, sigma) - generates a random gaussian with mu and sigma parameters

More Math

sq(number) - squares a number
cb(number) - cubes a number
sqrt(number) - gets the square root of a number
cbrt(number) - gets the cube root of a number
exp(number) - calculates e raised to the power of a number
pow(base, exponent) - calculates base raised to the power of exponent
root(number, root) - calculates nth root of a number
log(number[, base]) - calculates the logarythm of a number, with an optional base
log10(number) - calculates the base 10 logarythm of a number
log2(number) - calculates the base 2 logarythm of a number
tet(number, number) - calculates the teteration of two numbers
sroot(number, number) - calculates the super-root of two numbers
slog(number, number) - calculates the super-logarythm of two numbers
fact(number) - calculates the factorial of a number, decimals allowed
gamma(number) - the gamma function

Trigonometry

degrees(number) - converts number from radians to degrees
radians(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

Number to Base

[[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
Regular JavaScript Evaluation To evaluate regular javascript, put a ":" before text.





Large Operation Protection:
Off On
Special Settings
Allow Complex Catculations:
Off On
Enable Enhanced Calculating Experience:
Off On
Realistic Mode:
Off On
Enable Settings Menu:
Off On