next up previous contents index
Next: User-Defined Functions Up: The Scripting Language Previous: ``Preprocessor'' Directives   Contents   Index


Math Functions

The following math functions are defined internally.

Name Returns
abs(x) absolute value of x
acos(x) arc-cosine of x
asin(x) arc-sine of x
atan(x) arc-tangent of x
atan2(x, y) arc tangent of x, y
acosh(x) arc-hyperbolic cosine of x
asinh(x) arc-hyperbolic sine of x
atanh(x) arc-hyperbolic tangent of x
ceil(x) smallest integer > = x
cos(x) cosine of x
cosh(x) hyperbolic cosine of x
exp(x) e to the x power
floor(x) largest integer < = x
gauss() gaussian random number
int(x) truncated integer value of x
ln(x) natural logarithm of x
log(x) base 10 logarithm of x
random() random value in [0, 1)
rint(x) integer nearest to x
seed(x) seed random number generator
sgn(x) +1, 0, - 1 if x > 0, x = 0, x < 0
sin(x) sine of x
sinh(x) hyperbolic sine of x
sqrt(x) square root of x
tan(x) tangent of x
tanh(x) hyperbolic tangent of x

These functions behave as do the corresponding functions in the C library, though the random number functions are specialized to Xic. The seed function applies a seed value to the random number generators. This can be used to ensure that successive runs using random numbers choose different values. The seed value given is converted to an integer before use. The random function returns a random value in the range [0 - - 1). The numbers generated have a uniform distribution. The gauss function returns Gaussian random numbers with zero mean and unit deviation.


next up previous contents index
Next: User-Defined Functions Up: The Scripting Language Previous: ``Preprocessor'' Directives   Contents   Index
Stephen R. Whiteley 2006-10-23