WMLScript » Float » Float.maxFloat

Syntax:
Float.maxFloat()

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

The Float.maxFloat function returns the maximum (biggest) single-precision floating-point number that is supported by the browser.

The companion Float.minFloat function returns the minimum (smallest) nonzero single-precision floating-point number that is supported by the browser.

If the browser does not support floating-point arithmetic operations, then the browser will not recognize the Float Library, nor any of the member functions. In this case, the Float.maxFloat function returns invalid.

This function does not take a parameter.

Examples

Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>

<card id="card1">
   <p>
   sqrt example
   </p>
   <do type="accept">
      <go href="MaxFloatExample.wmls#findmaxfloat()" />
   </do>
</card>

<card id="card2">
<p>
   maximum = $(max)
   <br />
   minimum = $(min)
</p>
</card>

</wml>
Explanation:

Code for MaxFloatExample.wml

Language(s): WML
Code:
extern function findmaxfloat()
{
   var maxresult = Float.maxFloat();
   WMLBrowser.setVar("max", maxresult);
   var minresult = Float.minFloat();
   WMLBrowser.setVar("min", minresult);
   WMLBrowser.go("MaxFloatExample.wml#card2");
};
Explanation:

Code for MaxFloatExample.wmls

Language(s): WML

See Also: