The Float Library

The Float Library is a continuation of arithmetic functions, specifically designed to handle numbers that contain decimal points.

At the time of this writing, not all WAP device browsers support decimal point numbers. Devices today have difficulty handling the arithmetic of numbers, let alone decimal numbers.

Table 12.2 lists the built-in functions available in the Float Library.

Table 12.2. The Built-In Functions of the Float Library
Function Syntax Argument Description Example
ceil
Float.ceil 
(number) 
Floatingpoint number. Returns the largest integer number available within the device. This number is not less than the floating-point number defined in the function’s argument.
Float.ceil(3.12); 
floor
Float.floor 
(

Get WAP 2.0 Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.