O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

floor — Return the floor of a floating-point value

Usage

Float.floor(num)

num : Floating point

Description

Returns the largest integer value that is less than or equal to num. Returns num itself if it’s an integer. Returns invalid if num can’t be converted to floating point or if the result won’t fit into an integer.

Examples

Float.floor(17.0)

returns integer 17

Float.floor(17.4)

returns integer 17

Float.floor(17.5)

returns integer 17

Float.floor(-17.0)

returns integer -17

Float.floor(-17.4)

returns integer -18

Float.floor(-17.5)

returns integer -18

Float.floor(5e10)

returns invalid

Float.floor(-5e10)

returns invalid

Float.floor("foo")

returns invalid

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required