Functions providing math support to Falcon.
This group includes mathematical, trigonometrical and floating point conversion functions.
Returns the absolute value of a number.
abs( x )
x | A number. |
Return | The absolute value of the parameter. |
If the argument is an integer, then an integer is returned, otherwise the return value will be a floating point number.
Returns the arc cosine of the argument.
acos( x )
x | Argument. | ||
Return | The arc cosine of the argument. | ||
Raise |
|
This function computes the principal value of the arc cosine of its argument x. The value of x should be in the range [-1,1].
The return value is expressed in radians.
The function may raise a Math error if the value cannot be computed because of domain or overflow errors.
Returns the arc sine of the argument.
asin( x )
x | Argument. | ||
Return | The arc sine of the argument. | ||
Raise |
|
The return value is expressed in radians.
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Returns the arc tangent of the argument.
atan( x )
x | Argument. | ||
Return | The arc tangent of the argument. | ||
Raise |
|
This function computes the principal value of the arc tangent of its argument x. The value of x should be in the range [-1,1].
The return value is expressed in radians.
The function may raise a Math error if the value cannot be computed because of domain or overflow errors.
Returns the arc tangent of x / y.
atan2( x, y )
x | First argument. | ||
y | Second argument. | ||
Return | The arc tangent of the x / y. | ||
Raise |
|
This function computes the principal value of the arc tangent of x/y, using the signs of both arguments to determine the quadrant of the return value.
The return value is expressed in radians.
The function may raise a Math error if the value cannot be computed because of domain or overflow errors.
Returns the greatest integer near to the given value.
ceil( x )
x | Argument. |
Return | The ceil value. |
Ceil function returns the highest integer near to a given floating point number. For example, ceil of 1.1 is 2, and ceil of -1.1 is -1. If an integer number is given, then the function returns the same number.
Returns the combination of the arguments.
combinations( x, y )
x | First argument. |
y | Second arguments. |
Return | The combination of the arguments. |
The return value is expressed as a floating point value.
Note: For high values of x, the function may require exponential computational time and power.
Returns the cosine of the argument.
cos( x )
x | Argument. | ||
Return | The cosine of the argument. | ||
Raise |
|
The return value is expressed in radians.
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Converts an angle expressed in degrees into radians.
deg2rad( x )
x | An angle expressed in degrees. |
Return | The angle converted in radians. |
Returns exponential (e^x) of the argument.
exp( x )
x | Argument. | ||
Return | The exponential of the argument. | ||
Raise |
|
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Returns the factorial of the argument.
factorial( x )
x | Argument. |
Return | The factorial of the argument. |
The return value is expressed as a floating point value.
Note: For high values of x, the function may require exponential computational time and power.
Returns the integer part of a floating point number as a floating point number.
fint( x )
x | Argument. |
Return | A floating point number with fractional part zeroed. |
Fint function works like the core int function, but it returns a floating point number. For example, fint applied on 3.58e200 will return the same number, while int would raise a math error, as the number cannot be represented in a integer number that can store numbers up to +-2^63.
Returns the smallest integer near to the given value.
floor( x )
x | Argument. |
Return | The smallest integer near to the given value. |
Floor function returns the smallest integer near to a given floating point number. For example, floor of 1.9 is 1, and floor of -1.9 is -2. If an integer number is given, then the function returns the same number. This is similar to fint(), but in case of negative numbers fint would return the integer part; in case of -1.9 it would return -1.
Returns the fractional part of a number.
fract( x )
x | Argument. |
Return | The fractional part of a number. |
This function returns the non-integer part of a number. For example,
> fract( 1.234 )
would print 0.234.
Returns the natural logarithm of the argument.
log( x )
x | Argument. | ||
Return | The natural logarithm of the argument. | ||
Raise |
|
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Returns the common (base 10) logarithm of the argument.
log10( x )
x | Argument. | ||
Return | The common logarithm of the argument. | ||
Raise |
|
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Returns the modulo of two arguments.
mod( x, y )
x | Argument. | ||
y | Argument. | ||
Return | The modulo of the two argument; x mod y. | ||
Raise |
|
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Returns the permutation of the arguments.
permutations( x, y )
x | First argument. |
y | Second arguments. |
Return | The permutation of the arguments. |
The return value is expressed as a floating point value.
Note: For high values of x, the function may require exponential computational time and power.
Returns the first argument elevated to the second one (x^y)
pow( x, y )
x | Base. | ||
y | Exponent. | ||
Return | x^y | ||
Raise |
|
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Converts an angle expressed in radians into degrees.
rad2deg( x )
x | An angle expressed in radians. |
Return | The angle converted in degrees. |
Rounds a floating point to the nearest integer.
round( x )
x | Argument. |
Return | Nearest integer to x. |
Round returns the nearest integer value of a given floating point number. If the fractional part of the number is greater or equal to 0.5, the number is rounded up to the nearest biggest integer in absolute value, while if it's less than 0.5 the number is rounded down to the mere integer part. For example, 1.6 is rounded to 2, -1.6 is rounded to -2, 1.2 is rounded to 1 and -1.2 is rounded to -1.
Returns the sine of the argument.
sin( x )
x | Argument. | ||
Return | The sine of the argument. | ||
Raise |
|
The return value is expressed in radians.
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Returns the square root of the argument.
sqrt( x )
x | Argument. | ||
Return | The square root of the argument. | ||
Raise |
|
The function may raise an error if the value cannot be computed because of domain or overflow errors.
Returns the tangent of the argument.
tan( x )
x | Argument. | ||
Return | The tangent of the argument. | ||
Raise |
|
The return value is expressed in radians.
The function may raise an error if the value cannot be computed because of domain or overflow errors.