maths
Subcommands
| Subcommand | Description | Syntax |
|---|---|---|
e | Returns Euler’s number (2.718281828459045) | e() |
pi | Returns the value of pi (3.141592653589793) | pi() |
sin | Calculates the sine of a number in radians | sin(<expr>) |
cos | Calculates the cosine of a number in radians | cos(<expr>) |
tan | Calculates the tangent of a number in radians | tan(<expr>) |
sinh | Calculates the hyperbolic sine of a number in radians | sinh(<expr>) |
cosh | Calculates the hyperbolic cosine of a number in radians | cosh(<expr>) |
tanh | Calculates the hyperbolic tangent of a number in radians | tanh(<expr>) |
asin | Calculates the arcsine of a number in radians | asin(<expr>) |
acos | Calculates the arccosine of a number in radians | acos(<expr>) |
atan | Calculates the arctangent of a number in radians | atan(<expr>) |
asinh | Calculates the inverse hyperbolic sine of a number in radians | asinh(<expr>) |
acosh | Calculates the inverse hyperbolic cosine of a number in radians | acosh(<expr>) |
atanh | Calculates the inverse hyperbolic tangent of a number in radians | atanh(<expr>) |
exp | Calculates the base e exponential of a number (equivalent to e^x) | exp(<expr>) |
ln | Calculates the natural logarithm (base e) of a number | ln(<expr>) |
sqrt | Calculates the square root of a number | sqrt(<expr>) |
abs | Calculates the absolute value of a number | abs(<expr>) |
ceil | Calculates the ceiling (next highest integer) of a number | ceil(<expr>) |
floor | Calculates the floor (next lowest integer) of a number | floor(<expr>) |
log | Calculates the logarithm of a number in the provided base | log(<expr>, <expr>) |
pow | Raises a number to the power of another number | pow(<expr>, <expr>) |
nrt | Calculates the nth root of a number | nrt(<expr>, <expr>) |
add | Adds 2 numbers together | add(<expr>, <expr>) |
sub | Subtracts one number from another | sub(<expr>, <expr>) |
mul | Multiplies two numbers | mul(<expr>, <expr>) |
div | Divides one number by another | div(<expr>, <expr>) |
Examples
e
Returns Euler’s number:
| eval result=e()
pi
Returns the value of pi:
| eval result=pi()
sin
For a field angle containing 0, this example sets result to the sine (approximately 0):
| eval result=sin(angle)
cos
For a field angle containing 0, this example sets result to the cosine (1.0):
| eval result=cos(angle)
tan
For a field angle containing 0, this example sets result to the tangent (0.0):
| eval result=tan(angle)
sinh
For a field value containing 0, this example sets result to the hyperbolic sine (0.0):
| eval result=sinh(value)
cosh
For a field value containing 0, this example sets result to the hyperbolic cosine (1.0):
| eval result=cosh(value)
tanh
For a field value containing 0, this example sets result to the hyperbolic tangent (0.0):
| eval result=tanh(value)
asin
For a field value containing 0.5, this example sets result to the arcsine in radians:
| eval result=asin(value)
acos
For a field value containing 0.5, this example sets result to the arccosine in radians:
| eval result=acos(value)
atan
For a field value containing 1.0, this example sets result to the arctangent in radians:
| eval result=atan(value)
asinh
For a field value containing 0, this example sets result to the inverse hyperbolic sine:
| eval result=asinh(value)
acosh
For a field value containing 1.0, this example sets result to the inverse hyperbolic cosine:
| eval result=acosh(value)
atanh
For a field value containing 0.5, this example sets result to the inverse hyperbolic tangent:
| eval result=atanh(value)
exp
For a field x containing 2, this example sets result to e^x (approximately 7.389):
| eval result=exp(x)
ln
For a field value containing 2.718, this example sets result to the natural logarithm (approximately 1.0):
| eval result=ln(value)
sqrt
For a field value containing 16, this example sets result to the square root (4.0):
| eval result=sqrt(value)
abs
For a field value containing -5, this example sets result to the absolute value (5):
| eval result=abs(value)
ceil
For a field value containing 3.2, this example sets result to the ceiling (4):
| eval result=ceil(value)
floor
For a field value containing 3.7, this example sets result to the floor (3):
| eval result=floor(value)
log
For fields value containing 100 and base containing 10, this example sets result to the logarithm base 10 of 100 (2.0):
| eval result=log(value, base)
pow
For fields base containing 2 and exponent containing 8, this example sets result to 2 raised to the power of 8 (256):
| eval result=pow(base, exponent)
nrt
For fields value containing 27 and degree containing 3, this example sets result to the cube root of 27 (3.0):
| eval result=nrt(value, degree)
add
For fields a containing 5 and b containing 3, this example sets result to their sum (8):
| eval result=add(a, b)
sub
For fields a containing 10 and b containing 3, this example sets result to the difference (7):
| eval result=sub(a, b)
mul
For fields a containing 4 and b containing 3, this example sets result to their product (12):
| eval result=mul(a, b)
div
For fields numerator containing 10 and denominator containing 2, this example sets result to the quotient (5.0):
| eval result=div(numerator, denominator)