ceil (object -- ceilingValue)

Inputs

Outputs

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

Behavior

Example: ceiling of reals

ceil rounds Real32 and Real64 values up to a whole number, so 2.1 gives 3.0, -2.1 gives -2.0, and 2.0 stays 2.0.

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

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

Expected Output During Compilation

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

See also