NAME ^

runtime/wmlsfloat.pir - WMLScript Float library

DESCRIPTION ^

This library contains a set of typical arithmetic floating-point functions that are frequently used by applications.

See "WMLScript Standard Libraries Specification", section 8 "Float".

FUNCTIONS ^

int(value) ^

DESCRIPTION

Returns the integer part of the given value. If the value is already an integer, the result is the value itself.

PARAMETERS

value = Number

RETURN VALUE

Integer or invalid.

floor(value) ^

DESCRIPTION

Returns the greatest integer value that is not greater than the given value. If the value is already an integer, the result is the value itself.

PARAMETERS

value = Number

RETURN VALUE

Integer or invalid.

ceil(value) ^

DESCRIPTION

Returns the smallest integer value that is not less than the given value. If the value is already an integer, the result is the value itself.

PARAMETERS

value = Number

RETURN VALUE

Integer or invalid.

pow(value1, value2) ^

DESCRIPTION

Returns an implementation-dependent approximation to the result of raising value1 to the power of value2. If value1 is a negative number then value2 must be an integer.

PARAMETERS

value1 = Number

value2 = Number

RETURN VALUE

Floating-point or invalid.

EXCEPTIONS

If value1 == 0 and value2 < 0 then invalid is returned.

If value1 < 0 and value2 is not an integer then invalid is returned.

round(value) ^

DESCRIPTION

Returns the number value that is closest to the given value and is equal to a mathematical integer. If two integer number values are equally close to the value, the result is the larger number value. If the value is already an integer, the result is the value itself.

PARAMETERS

value = Number

RETURN VALUE

Integer or invalid.

sqrt(value) ^

DESCRIPTION

Returns an implementation-dependent approximation to the square root of the given value.

PARAMETERS

value = Floating-point

RETURN VALUE

Floating-point or invalid.

EXCEPTIONS

If value is a negative number then invalid is returned.

maxFloat() ^

DESCRIPTION

Returns the maximum floating-point value supported by [IEEE754] single precision floating-point format.

RETURN VALUE

Floating-point 3.40282347e+38.

minFloat() ^

DESCRIPTION

Returns the smallest nonzero floating-point value supported by [IEEE754] single precision floating-point format.

RETURN VALUE

Floating-point. Smaller than or equal to the normalised minimum single precision floating-point value: 1.17549435e-38.

AUTHORS ^

Francois Perrad.


parrot