Category | Expression | Definition |
|---|---|---|
Mathematical expression | + | Adds one number to another. For example, 2+3 results in 5. |
- | Subtracts one number from another. For example, 3-2 results in 1. | |
* | Multiplies one number by another. For example, 3*2 results in 6. | |
/ | Divides one number by another. For example, 3/2 results in 1.5. | |
% | Computes the modulo of two numbers. For example, 3%2 results in 1. | |
Relational expression | eq(x,y) | Checks whether x is equal to y. If so, 1 is returned. If not, 0 is returned. (Both x and y can be expressions, and this also applies to the following expressions.) |
ne(x,y) | Checks whether x is unequal to y. If so, 1 is returned. If not, 0 is returned. | |
ge(x,y) | Checks whether x is greater than or equal to y. If so, 1 is returned. If not, 0 is returned. | |
gt(x,y) | Checks whether x is greater than y. If so, 1 is returned. If not, 0 is returned. | |
le(x,y) | Checks whether x is less than or equal to y. If so, 1 is returned. If not, 0 is returned. | |
lt(x,y) | Checks whether x is less than y. If so, 1 is returned. If not, 0 is returned. | |
isnull(x) | Checks whether a variable is empty. If so, 1 is returned. If not, 0 is returned. In this expression, x is a global variable. For example, isnull(#var) is used to check whether var has a value. | |
not(x) | Checks whether x is equal to 0. If so, 1 is returned. If not, 0 is returned. | |
Function expression | int(x) | Abandons the decimal part. For example, the return value of int(4.5) is 4 and that of int(–4.5) is –4. |
rand(x,y) | Obtains a random value ranging from 0 to 1. The return value is of the float type. | |
int(rand()*a+b) | Obtains a random integer ranging from b to b + a. | |
sin(x) | Returns the sine of x, in radians. | |
cos(x) | Returns the cosine of x, in radians. | |
asin(x) | Returns a value ranging from –pi/2 to pi/2 if x ranges from –1 to 1, and returns 0 if the absolute value of x is greater than 1. | |
acos(x) | Returns a value ranging from –pi/2 to pi/2 if x ranges from –1 to 1, and returns 0 if the absolute value of x is greater than 1. | |
tan(x) | Returns the tangent of x. If the absolute value of x is close to a multiple of pi/2, an incorrect value may be returned due to the precision problem. | |
atan(x) | Returns the arc tangent of x. | |
sqrt(x) | Returns the square root of x. If the value of x is negative, 0 is returned. | |
abs(x) | Returns the absolute value of x. | |
min(x, y) | Returns the smaller value between x and y. | |
max(x, y) | Returns the larger value between x and y. | |
round(x) | Rounds off an input value. If the input value is negative and its decimal part is less than or equal to 0.5, round off the value to the larger integer; otherwise, round off the value to the smaller integer. For example, the return value of round(4.5) is 5 and that of round(–4.5) is –4. | |
pow(x,y) | Raises x to the power of y. For example, the return value of pow(2,3) is 8. | |
ceil(x) | Rounds up an input value. It returns the smallest integer greater than or equal to the input value. For example, the return value of ceil(2.3) is 3 and that of ceil(-2.3) is -2. | |
floor(x) | Rounds down an input value. It returns the largest integer less than or equal to the input value. For example, the return value of floor(2.3) is 2 and that of floor(-2.3) is -3. | |
cbrt(x) | Computes the cube root. |