ceil (object -- ceilingValue)
Inputs
object: Real object rounded upward.
Outputs
ceilingValue: Least whole-valued real not smaller thanobject.
ceil accepts Real32 and Real64 objects. The input is dereferenced and must be non-NIL.
Behavior
- A known non-whole positive real rounds upward to the next greater whole-valued real in the same schema.
- A known non-whole negative real rounds upward toward zero, for example
-2.1r32becomes-2.0r32. - A known whole-valued real is unchanged.
- An unknown real produces an unknown value of the same real schema.
- The result keeps the same real schema as the input. It does not become an Int.
Example
{} () {} [
"-- 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
^builtin(base exponent -- power)Raises one Real object to another of the same schema and keeps that real schema in the result.castbuiltin(object schema -- convertedValue)Casts a Cond or numeric object to the numeric schema selected by theschemainput.cosbuiltin(angle -- cosine)Computes the cosine of a Real object and keeps the same real schema.floorbuiltin(object -- floorValue)Rounds a Real object downward and keeps the same real schema.logbuiltin(argument -- naturalLogarithm)Computes the natural logarithm of a Real object and keeps the same real schema.log10builtin(argument -- decimalLogarithm)Computes the base-10 logarithm of a Real object and keeps the same real schema.negbuiltin(object -- negatedValue)Negates a signed Int or Real object and keeps the same schema.sinbuiltin(angle -- sine)Computes the sine of a Real object and keeps the same real schema.sqrtbuiltin(radicand -- squareRoot)Computes the square root of a Real object and keeps the same real schema.