WMLScript » Functions » Float

The Float Library contains eight functions. Six of these functions perform a variety of mathematic procedures and the other two functions return information about numeric boundaries set by the browser.

Of the six WMLScript standard libraries, only the implementation of the Float Library is considered optional. All eight functions require that the browser be able to support floating-point arithmetic operations. If the browser does not recognize floating-point, then these functions cannot perform their purpose and they will all return invalid.

The Lang Library contains several functions that perform related tasks regarding integer and floating-point numbers.

The library and function names are case senstive.

Float.ceil

Syntax: Float.ceil(value)

Rounds a floating-point number up to the next larger integer value.

Float.floor

Syntax: Float.floor(value)

Rounds a floating-point number down to the next smaller integer value.

Float.int

Syntax: Float.int(value)

Returns the integer portion of a floating-point number.

Float.maxFloat

Syntax: Float.maxFloat()

Returns the largest floating-point number supported by the browser.

Float.minFloat

Syntax: Float.minFloat()

Returns the smallest nonzero floating-point number supported by the browser.

Float.pow

Syntax: Float.pow(value, power)

Raises a floating-point or integer number up to a power.

Float.round

Syntax: Float.round(value)

Rounds a floating-point number up or down to the nearest integer.

Float.sqrt

Syntax: Float.sqrt(value)

Returns the square root of a floating-point or integer number.

See Also: