Instant properties: floor
The instant property floor represents the given float operand rounded to the next lowest integer value.
Declaration
float float.floor
Discussion
The instant property floor returns a rounded value by calculating the next lowest integer value of the operand in context of which the property is evaluated. Please note, the instant property floor is read-only. The write access to this property is not allowed. For example:
var float f1 = 11.3; var float f2 = -5.3; var float result1 = f1.floor; // result1 = 11.0 var float result2 = f2.floor; // result2 = -6.0 // Write access is not allowed f1.floor = 10.0; // Chora Compiler error
See also the built-in function math_floor() as well as the cognate instant properties ceil, round, trunc and fract.