WebSiphon 2 Guide: Math Functions
contents prev next

abs
acos
asin
atan
ceil
cos
degrees
floor
log
log10
pow
radians
sin
sqrt
tan
abs ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the absolute value of number.

Examples:

  1. print abs(3.14);
    >> 3.14
  2. print abs(-3.14);
    >> 3.14
asin ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the arc sine of number in radians.

acos ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the arc cosine of number in radians.

atan ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the arc tangent of number in radians.

ceil ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the smallest integer greater than number. If number is an even integer it will not be changed.

Examples:

  1. print ceil(3.14);
    >> 4
  2. print ceil(3);
    >> 3
cos ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the standard cosine of number in radians.

degrees ( radians )
Returns: float Location: Built-in
ParameterDescription
radiansany numeric value

Translates radians to degrees.

floor ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the largest integer less than number. If number is an even integer it will not be changed.

Example:

  1. print floor(3.14);
    >> 3
  2. print floor(3);
    >> 3
log ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the natural logarithm of number.

log10 ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the base-10 logarithm of number.

pow ( number1, number2 )
Returns: float Location: Built-in
ParameterDescription
number1any numeric value
number2any numeric value

Returns the value of number1 to the power of number2.

radians ( degrees )
Returns: float Location: Built-in
ParameterDescription
degreesany numeric value

Translates degrees to radians.

sin ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the standard sine of number in radians.

sqrt ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the square root of number.

tan ( number )
Returns: float Location: Built-in
ParameterDescription
numberany numeric value

Returns the tangent of number in radians.

contents prev next

Copyright (c)1996-2003 Purity Software