User Tools

Site Tools


lgscript:math_library

Math Library

Mathematical functions that work with real numbers.

abs

Absolute value.

Returns number
Parameter number

acos

Arc cosine, in radians.

Returns number
Parameter number

asin

Arc sine, in radians.

Returns number
Parameter number

atan

Arc tangent, in radians.

Returns number
Parameter number

atan2

Arc tangent, in radians.

Returns number
Parameter number y
Parameter number x

Returns the arc tangend of y/x. The signs of the parameters are used to determine the correct quadrant. The function will not fail if x is zero.

ceil

Round to the next larger integer.

Returns number
Parameter number

cos

Cosine using radians.

Returns number
Parameter number

cosh

Hyperbolic cosine.

Returns number
Parameter number

deg

Convert radians to degrees.

Returns number
Parameter number

exp

Natural exponent.

Returns number
Parameter number

floor

Round to the next smaller integer.

Returns number
Parameter number

fmod

Remainder of x/y.

Returns number
Parameter number x
Parameter number y

frexp

Returns number,number m,e
Parameter number x

x=m2e

huge

The largest possible number. A constant.

ldexp

Returns number x
Parameter number m
Parameter number e

x=m2e

log

Natural logarithm.

Returns number
Parameter number

log10

Logarithm base-10.

Returns number
Parameter number

max

The largest of the given values.

Returns number
Parameter number ...

min

The smallest of the given values.

Returns number
Parameter number ...

modf

The integer and fractional parts of a number.

Returns number,number
Parameter number

pi

The ratio of the circumference of a circle to its diameter. A constant.

pow

Raise the first parameter to the power of the second parameter.

Returns number
Parameter number
Parameter number

rad

Convert degrees to radians.

Returns number
Parameter number

random

Return a slightly unpredictable number.

Returns number
Parameter number (opt.)
Parameter number (opt.)

A pseudo-random number generator returns a sequence of numbers that seems to have no pattern.

If no parameters are given, then the return value is greater than or equal to 0 and less than 1. With parameters, the result is an integer. Only one parameter sets the largest number to return (the smallest is 1), and using two parameters sets the lowest and highest numbers in the range.

randomseed

Prepare the pseudo-random number generator.

Parameter number

round

Round to a number of decimal digits.

Returns number
Parameter number
Parameter number (opt.) Default is 0.

sin

Sine using radians.

Returns number
Parameter number

sinh

Hyperbolic sine.

Returns number
Parameter number

sqrt

Square root.

Returns number
Parameter number

tan

Tangent using radians.

Returns number
Parameter number

tanh

Hyperbolic tangent.

Returns number
Parameter number
lgscript/math_library.txt · Last modified: 2011/05/21 01:55 by telliamed