A tiny math expression evaluation engine and an interactive calculator.
operator | description |
---|---|
( ) |
expression group |
x ** y |
exponent |
+x |
unary plus |
-x |
unary plus |
!x |
logical NOT |
~x |
bitwise NOT |
x * y |
multiplication |
x / y |
division |
x // y |
floor division |
x % y |
remainder |
x + y |
addition |
x - y |
subtraction |
x << y |
bitwise left shift |
x >> y |
bitwise right shift |
x < y |
less than |
x <= y |
less than or equal |
x > y |
greater than |
x >= y |
greater than or equal |
x == y |
equal |
x != y |
not equal |
x & y |
bitwise AND |
x ^ y |
bitwise XOR |
x | y |
bitwise OR |
x && y |
logical AND |
x || y |
logical OR |
x ?: y |
coalescing, x ? x : z
|
x ?? y |
coalescing, x ? x : z
|
x ? y : z |
ternary |
See https://en.cppreference.com/w/cpp/language/operator_precedence, https://docs.python.org/3/reference/expressions.html#operator-precedence, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence and https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more document.
name | value |
---|---|
e |
2.71828182845904523536 |
pi |
3.14159265358979323846 |
See https://en.cppreference.com/w/cpp/numeric/math and https://docs.python.org/3/library/math.html for function description.