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.


Syntax: Float.ceil(value)

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


Syntax: Float.floor(value)

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


Syntax: Float.int(value)

Returns the integer portion of a floating-point number.


Syntax: Float.maxFloat()

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


Syntax: Float.minFloat()

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


Syntax: Float.pow(value, power)

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


Syntax: Float.round(value)

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


Syntax: Float.sqrt(value)

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

See Also: