1.14Math functions.

Functions providing math support to Falcon.

This group includes mathematical, trigonometrical and floating point conversion functions.

Functions

abs

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.

acos

Returns the arc cosine of the argument.

acos( x )
x Argument.
ReturnThe arc cosine of the argument.
Raise
 MathError If the argument is out of domain.

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.

asin

Returns the arc sine of the argument.

asin( x )
x Argument.
ReturnThe arc sine of the argument.
Raise
 MathError If the argument is out of domain.

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.

atan

Returns the arc tangent of the argument.

atan( x )
x Argument.
ReturnThe arc tangent of the argument.
Raise
 MathError If the argument is out of domain.

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.

atan2

Returns the arc tangent of x / y.

atan2( x, y )
x First argument.
y Second argument.
ReturnThe arc tangent of the x / y.
Raise
 MathError If the argument is out of domain.

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.

ceil

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.

combinations

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.

cos

Returns the cosine of the argument.

cos( x )
x Argument.
ReturnThe cosine of the argument.
Raise
 MathError If the argument is out of domain.

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.

 x An angle expressed in degrees. Return The angle converted in radians.

exp

Returns exponential (e^x) of the argument.

exp( x )
x Argument.
ReturnThe exponential of the argument.
Raise
 MathError If the argument is out of domain.

The function may raise an error if the value cannot be computed because of domain or overflow errors.

factorial

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.

fint

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.

floor

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.

fract

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.

log

Returns the natural logarithm of the argument.

log( x )
x Argument.
ReturnThe natural logarithm of the argument.
Raise
 MathError If the argument is out of domain.

The function may raise an error if the value cannot be computed because of domain or overflow errors.

log10

Returns the common (base 10) logarithm of the argument.

log10( x )
x Argument.
ReturnThe common logarithm of the argument.
Raise
 MathError If the argument is out of domain.

The function may raise an error if the value cannot be computed because of domain or overflow errors.

mod

Returns the modulo of two arguments.

mod( x, y )
x Argument.
y Argument.
ReturnThe modulo of the two argument; x mod y.
Raise
 MathError If the argument is out of domain.

The function may raise an error if the value cannot be computed because of domain or overflow errors.

permutations

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.

pow

Returns the first argument elevated to the second one (x^y)

pow( x, y )
x Base.
y Exponent.
Returnx^y
Raise
 MathError If the argument is out of domain.

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.

 x An angle expressed in radians. Return The angle converted in degrees.

round

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.

sin

Returns the sine of the argument.

sin( x )
x Argument.
ReturnThe sine of the argument.
Raise
 MathError If the argument is out of domain.

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.

sqrt

Returns the square root of the argument.

sqrt( x )
x Argument.
ReturnThe square root of the argument.
Raise
 MathError If the argument is out of domain.

The function may raise an error if the value cannot be computed because of domain or overflow errors.

tan

Returns the tangent of the argument.

tan( x )
x Argument.
ReturnThe tangent of the argument.
Raise
 MathError If the argument is out of domain.

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.