MATH::FLOOR 1g 2023 laplante@plcb.ca GOWEB/MATH


title: “MATH::FLOOR Function” author: “Pierre Laplante laplante@plcb.ca” date: “2023” version: “1.0.0” section: “1g”

category: “GOWEB/MATH”

Name

math::floor returns the greatest integer value less than or equal to x.

Synopsis

math::floor or floor(expression[, decimal: integer])

Description

The math::floor function returns the greatest integer value less than or equal to x.
When the optional decimal parameter is provided (from 0 to 10), the result is rounded down to the specified number of decimal places.

Parameters

Examples

res={{
    floor(2.5);
    floor(-2.5);
    floor([1, 2.3, "4.56"]);
    floor(decimal: 2, [1, 2.3, "4.56"]);
    floor(decimal: 2, {"x":1, "y":2.3, "z":"4.56"});
    floor(decimal: 2, {"x":1, "y":2.3, "z":["3.1415926535", 2.7182818]});
    a := floor(decimal:2, {"x1" : [5.5, -5.5, 3.1415926535, -3.99], "y1": 2.7182818});
    a := floor({"x1" : [5.5, -5.5, 3.1415926535, -3.99], "y1": 2.7182818}, decimal:3);
    a;
    "\n";
    floor(1, 2.3, [4, "5.6"]);
}}.

returns

res=2-3[1,2,4][1,2.29,4.55]{"x":1,"y":2.29,"z":4.55}{"x":1,"y":2.29,"z":[3.14,2.71]}{"x1":[5.5,-5.5,3.141,-3.99],"y1":2.718}
[1,2,[4,5]].

Author

Pierre Laplante laplante@plcb.ca

See also

Version