Go to main content

floor

Largest integral value not greater than argument.

FLOOR

NAME

floor - Largest integral value not greater than argument.

SYNOPSIS

floor(variabler[, decimal:integer]);

DESCRIPTION

This function rounds down to the nearest integer. This means that it will return the smallest integer possible. It is replacing the value by an approximately equal but shorter value. If var is a string, than the string is converted to a double. If var is a complex object, all items within the objects are being returned as an absolute value. A deep copy of the object is returned.

From version 5.170.1, parameter decimal (from 0 to 10) has been added to spcify number of decimal.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{floor(-2.5); }}. return res=-3.
res={_{floor("-2.5"); }}. return res=-3.
res={_{a=[-2, 2, 2.5, { x : -2.5 } ]; floor(a); a;}}. return res=[-2,2,2,{"x":-3}][-2,2,2.5,{"x":-2.5}].

SEE ALSO

{{ include("includes/maths.sn") }}

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.