Don't get lost: IMan Guides » IMan User Guide » References » VBScript Functions » Math Functions

Math Functions

Abs

Description

Returns the absolute value of a number.

Syntax

  • Abs( number )

Arguments

  • Number
    • Any valid numeric expression. If number contains Null, Null is returned; if it is an uninitialized variable, zero is returned.

Atn

Description

Returns the arctangent of a number.

Syntax

  • Atn( number )

Arguments

  • number
    • A numeric expression.

Cos

Description

Returns the cosine of an angle.

Syntax

  • Cos( number )

Arguments

  • number
    • A numeric expression.

Exp

Description

Returns 'e' raised to the 'n'th power, where e = 2.71828183.

Syntax

  • Exp( number )

Arguments

  • number
    • The power to raise 'e' to.

Fix

Description

Returns the integer portion of a number.

Syntax

  • Fix( expression )

Arguments

  • expression
    • A numeric expression whose integer portion is returned.
    • If the expression is negative, the Fix function will return the first negative number that is greater than or equal to the expression.

Int

Description

Returns the integer portion of a number.

Syntax

  • Int( expression )

Arguments

  • expression
    • A numeric expression whose integer portion is returned. If the expression is negative, the Int function will return the first negative number that is less than or equal to the expression.

Log

Description

Returns the logarithm of a number to a specified base.

Syntax

  • Log( number, base )

Arguments

  • number
    • A numeric value that must be greater than 0.
  • base
    • Optional. This is the base to use to calculate the logarithm of a number. If this parameter is omitted, the Log function will use a base of 10.

Rnd

Description

Returns a random number. The Rnd function returns a value less than 1 but greater than or equal to 0.

Syntax

  • Rnd[(number)]

Arguments

  • number
    • Optional and can be any valid numeric expression.

If number is

Rnd generates

Less than zero

The same number every time, using number as the seed.

Greater than zero

The next random number in the sequence.

Equal to zero

The most recently generated number.

Not supplied

The next random number in the sequence.

   

Round

Description

Returns a number rounded to a specified number of digits.

Syntax

  • Round( number, digits )

Arguments

  • number
    • The number to round.
  • digits
    • The number of digits to round the number to.

Sgn

Description

Returns the sign of a number (represented as an integer).

Syntax

  • Sgn ( number )

Arguments

  • number
    • The number to return the sign for.
    • If number is greater than zero, the Sgn function will return 1.
    • If number is equal to zero, the Sgn function will return 0.
    • If number is less than zero, the Sng function will return -1.

Sin

Description

Returns the sine of an angle.

Syntax

  • Sin( number )

Arguments

  • number
    • A numeric value.

Sqr

Description

Returns the square root of a number.

Syntax

  • Sqr(number)

Arguments

  • number
    • Any valid numeric expression greater than or equal to 0.

Tan

Description

Returns the tangent of an angle.

Syntax

  • Tan( number )

Arguments

  • number
    • A numeric value.