math...
The following mathematical functions and constants are supported by ThingsDB:
| Constant |
Value |
Description |
MATH_E |
2.71828… |
The base of natural logarithms. |
MATH_PI |
3.14159… |
Pi, the ratio of a circle’s circumference to its diameter. |
Math functions
| Function |
Description |
| abs |
Returns the absolute value of a given number. |
| ceil |
Returns the ceiling of a given number as integer. |
| cos |
Return the cosine of a given number (measured in radians). |
| exp |
Return e raised to the power of a given number. |
| floor |
Returns the floor of a given number as integer. |
| log10 |
Return the base 10 logarithm of a given number. |
| log2 |
Return the base 2 logarithm of a given number. |
| loge |
Returns the natural logarithm (base e) of a given number. |
| pow |
Returns x to the power of y. |
| round |
Returns a number rounded to the provided decimal places. |
| sin |
Return the sine of a given number (measured in radians). |
| sqrt |
Return the square root of a given number. |
| tan |
Return the tangent of a given number (measured in radians). |