-
Notifications
You must be signed in to change notification settings - Fork 6
Built in Operators and Functions
Brandon Wood edited this page Apr 17, 2016
·
7 revisions
The following lists show the built-in operators and functions that are included in dotMath. You can further extend the functionality of dotMath by adding your own functions and registering them with dotMath before compiling. Check out Getting Started to learn more.
Operator | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
% | Modulus (returns the remainder of a division operation) |
^ | Exponent (x^y = xy) |
Operator | Description |
---|---|
== | Returns 1 if both sides are equal. |
!= | Returns 1 if the left side is not equal to the right. |
<> | Returns 1 if the left side is not equal to the right. |
< | Returns 1 if left side is less than the right. |
> | Returns 1 if left side is greater than the right. |
<= | Returns 1 if the left side is less than or equal to the right. |
>= | Returns 1 if the left side is greater than or equal to the right. |
&& | Returns 1 if both sides are true. |
|| | Returns 1 if either side is true. |
Function | Description |
---|---|
abs | Absolute value of a specified value or expression. |
acos | Returns the angle whose cosine is the specified number. |
asin | Returns the angle whose sin is the specified number. |
atan | Returns the angle whose tangent is the specified number. |
ceiling | Returns the smallest whole number greater than or equal to the specified number. |
cos | Returns the cosine of the specified angle. |
cosh | Returns the hyperbolic cosine of the specified angle. |
exp | Returns e raised to the specified power. |
floor | Returns the largest whole number less than or equal to the specified number. |
log | Returns the logarithm of the specified number. |
log10 | Returns the base 10 logarithm of the specified number. |
round | Returns the value nearest the specified value. |
sign | Returns a value indicating the sign of the specified value. |
sin | Returns the sine of the specified angle. |
sinh | Returns the hyperbolic sine of the specified angle. |
sqrt | Returns the square root of the specified number. |
tan | Returns the tangent of the specified angle. |
tanh | Returns the hyperbolic tangent of the specified angle. |
min |
min(expr1, expr2) Returns the minimum value among 2 elements. |
max |
max(expr1, expr2) Returns the maximum value among 2 elements. |
if |
if(binaryExpression, trueExpression, falseExpression) If the value of binaryExpression is true, the trueExpression evaluation is returned. Otherwise the falseExpression is returned. |