namespace Math

Provides a set of mathematical functions

namespace attributes [NB. highlighted items are covered in other pages - namespaces or classes]
function abs() - Calculates the absolute value of a number
function acos() - Calculates the arc cosine of a number
function asin() - Calculates the arc sine of a number
function atan() - Calculates the arc tangent of a number
function atan2() - Calculates the arc tangent of two numbers
function ceil() - Rounds a number up to the nearest integer value
function cos() - Calculates the cosine of a number
function exp() - Calculates the value of e raised to the specified power
function floor() - Rounds a number down to the nearest integer value
function getRandMax() - Finds the maximum value that Math.rand() can return
function log() - Calculates the natural logarithm of a number
function log10() - Calculates the base 10 logarithm of a number
function max() - Determines which of two numbers is the larger
function min() - Determines which of two numbers is the smaller
function pi() - Returns the number Pi
function pow() - Calculates the value of a number raised to a power
function rand() - Generates a pseudo-random number
function srand() - Seeds the pseudo-random number generator
function round() - Rounds a number to the nearest integer
function sin() - Calculates the sine of a number
function sqrt() - Calculates the square root of a number
function tan() - Calculates the tangent of a number
function isDouble() - Checks if a number is represented internally as a double
function isLong() - Checks if a number is represented internally as a long
class Complex - Provides methods for manipulating complex numbers

Functions

function abs Click to go up to the list
Calculates the absolute value of a number
Declaration:
    native function abs( number num )
Parameters:
    Parameter #1: number num - The number to calculate the absolute value of
Returns:
    The absolute value of the number

function acos Click to go up to the list
Calculates the arc cosine of a number
Declaration:
    native function acos( number degree )
Description:
This function calculates the arc cosine of the specified value and returns it in radians. Note: The input value must be between -1 and 1.
Parameters:
    Parameter #1: number degree - The number to calculate the arc cosine of
Returns:
    The arc cosine of the specified value in radians

function asin Click to go up to the list
Calculates the arc sine of a number
Declaration:
    native function asin( number degree )
Description:
This function calculates the arc sine of the specified value and returns it in radians. Note: The input value must be between -1 and 1.
Parameters:
    Parameter #1: number degree - The number to calculate the arc sine of
Returns:
    The arc sine of the specified value in radians

function atan Click to go up to the list
Calculates the arc tangent of a number
Declaration:
    native function atan( number degree )
Parameters:
    Parameter #1: number degree - The number to calculate the arc tangent of
Returns:
    The arc tangent of the specified value in radians

function atan2 Click to go up to the list
Calculates the arc tangent of two numbers
Declaration:
    native function atan2( number x, number y )
Description:
This function calculates the arc tangent of the two specified variables. It is like calculating the arc tangent of x/y, but the signs of both arguments are used when determining what quadrant the result is in.
Parameters:
    Parameter #1: number x - The first number to use in the calculation
    Parameter #2: number y - The second number to use in the calculation
Returns:
    The arc tangent of the two values in radians

function ceil Click to go up to the list
Rounds a number up to the nearest integer value
Declaration:
    native function ceil( number num )
Parameters:
    Parameter #1: number num - The number
Returns:
    The smallest integer that is greater than or equal to the input

function cos Click to go up to the list
Calculates the cosine of a number
Declaration:
    native function cos( number degree )
Parameters:
    Parameter #1: number degree - The angle in radians to calculate the cosine of
Returns:
    The cosine of the specified angle as a number between -1 and 1

function exp Click to go up to the list
Calculates the value of e raised to the specified power
Declaration:
    native function exp( number power )
Parameters:
    Parameter #1: number power - The value to raise e to the power of
Returns:
    e (the base of natural logrithms) raised to the specified power

function floor Click to go up to the list
Rounds a number down to the nearest integer value
Declaration:
    native function floor( number num )
Parameters:
    Parameter #1: number num - The number
Returns:
    The largest integer that is smaller than or equal to the input

function getRandMax Click to go up to the list
Finds the maximum value that Math.rand() can return
Declaration:
    native function getRandMax( )
Returns:
    The largest value that Math.rand() can return

function log Click to go up to the list
Calculates the natural logarithm of a number
Declaration:
    native function log( number num )
Parameters:
    Parameter #1: number num - The number
Returns:
    The natural logarithm of the specified number

function log10 Click to go up to the list
Calculates the base 10 logarithm of a number
Declaration:
    native function log10( number num )
Parameters:
    Parameter #1: number num - The number
Returns:
    The base 10 logarithm of the specified number

function max Click to go up to the list
Determines which of two numbers is the larger
Declaration:
    native function max( number num1, number num2 )
Parameters:
    Parameter #1: number num1 - The first number
    Parameter #2: number num2 - The second number
Returns:
    The value of the larger of the two numbers

function min Click to go up to the list
Determines which of two numbers is the smaller
Declaration:
    native function min( number num1, number num2 )
Parameters:
    Parameter #1: number num1 - The first number
    Parameter #2: number num2 - The second number
Returns:
    The value of the smaller of the two numbers

function pi Click to go up to the list
Returns the number Pi
Declaration:
    native function pi()

function pow Click to go up to the list
Calculates the value of a number raised to a power
Declaration:
    native function pow( number base, number exp )
Parameters:
    Parameter #1: number base - The number
    Parameter #2: number exp - The power to raise the number to
Returns:
    The value of base raised to the power of exp

function rand Click to go up to the list
Generates a pseudo-random number
Declaration:
    native function rand()
Description:
This function returns a pseudo-random number. Before using it, you should call Math.srand() to seed the pseudo-random number generator. The value returned will always be between 0 and the value returned by Math.getRandMax().
Returns:
    a pseudo-random number

function srand Click to go up to the list
Seeds the pseudo-random number generator
Declaration:
    native function srand( number seed )
Description:
This function should be called before using Math.rand() to seed the pseudo-random number generator. It is common practice to use the current time, as returned by the function Sys.Time() as a seed for many tasks. Note that the sequence of numbers from the random number generator is determined by the seed, so if you reseed it with the a value you used previously the same sequence of random numbers will be generated. This is sometimes useful behaviour because it allows you to reproduce a "random" sequence any time simply by remembering what the seed value was.
Parameters:
    Parameter #1: number seed - The number to seed the pseudo-random number generator with

function round Click to go up to the list
Rounds a number to the nearest integer
Declaration:
    native function round( number num )
Description:
This function differs from Math.ceil() and Math.floor() because it will round either up or down, depending on whether the input is less than or greater than half way to the next integer up. Note that the current implementation will break if the input number is greater than that which can be represented by a signed long (about 2 billion on a 32 bit processor).
Parameters:
    Parameter #1: number num - The number
Returns:
    The number rounded to the nearest integer

function sin Click to go up to the list
Calculates the sine of a number
Declaration:
    native function sin( number degree )
Parameters:
    Parameter #1: number degree - The angle in radians to calculate the sine of
Returns:
    The sine of the specified angle as a number between -1 and 1

function sqrt Click to go up to the list
Calculates the square root of a number
Declaration:
    native function sqrt( number num )
Parameters:
    Parameter #1: number num - The number (must not be negative)
Returns:
    The square root of the specified number

function tan Click to go up to the list
Calculates the tangent of a number
Declaration:
    native function tan( number degree )
Parameters:
    Parameter #1: number degree - The angle in radians to calculate the tangent of
Returns:
    The tangent of the specified angle as a number between -1 and 1

function isDouble Click to go up to the list
Checks if a number is represented internally as a double
Declaration:
    native function isDouble( number n )
Parameters:
    Parameter #1: number n - The number
Returns:
    True if the number is stored as a double, false if it is not

function isLong Click to go up to the list
Checks if a number is represented internally as a long
Declaration:
    native function isLong( number n )
Parameters:
    Parameter #1: number n - The number
Returns:
    True if the number is stored as a long, false if it is not

Automatically generated at 8:45pm, Wednesday 08 January 2003 by feritedoc.