floor (object -- floorValue)

Inputs

Outputs

floor accepts Real32 and Real64 objects. The input is dereferenced and must be non-NIL.

Behavior

Example: floor of reals

floor rounds Real32 and Real64 values down to a whole number, so 2.9 gives 2.0, -2.1 gives -3.0, and -2.0 stays -2.0.

{} () {} [
  "-- real32 --" printCompilerMessage
  2.9r32 floor printStack _:;
  -2.1r32 floor printStack _:;
  -2.0r32 floor printStack _:;

  "-- real64 --" printCompilerMessage
  2.9 floor printStack _:;
  -2.1 floor printStack _:;
  -2.0 floor printStack _:;
] "main" exportFunction

Expected Output During Compilation

-- real32 --
2.0r32
-3.0r32
-2.0r32
-- real64 --
2.0
-3.0
-2.0

See also