NLP++ now features mathematical functions analogous to those provided in C/C++.
|
FUNCTION NAME |
RETURNS |
DESCRIPTION |
|
abs(num) |
NUM |
Get the absolute value of a number. |
|
NUM |
Round a number up to the nearest whole number. Analogous to the ceil function in C/C++. | |
|
factorial(num) |
NUM |
Get the factorial of a whole number. |
|
NUM |
Round a number down to the nearest whole number. Analogous to the floor function in C/C++. | |
|
FLOAT |
Get the natural (base e) logarithm of a number. Analogous to the log function in C/C++. | |
|
FLOAT |
Get the base 10 logarithm of a number. Analogous to the log10 function in C/C++. | |
|
mod(num,num) |
NUM |
Get the remainder after dividing the first number by the second. Analogous to the % operator in C/C++. |
|
FLOAT |
Raise a number to the given power. Analogous to the pow function in C/C++. | |
|
randomint(num,num) |
NUM |
Get a random whole number between the two given numbers, inclusive. |
|
NUM |
Round a number to the nearest whole number, with halfway cases rounding away from zero. Analogous to the round function in C/C++. | |
|
FLOAT |
Get the square root of a number. Analogous to the sqrt function in C/C++. | |
|
NUM |
Discard the fractional part of a number, rounding toward zero. Analogous to the trunc function in C/C++. |