
ceiling(+Number, ?Result)

   Unifies Result with the least integral value that is greater than or equal to
Number and of the same numeric type as Number.



Arguments
   +Number             A number.
   ?Result             A variable or number.

Type
   Arithmetic

Description
   This predicate is used by the ECLiPSe compiler to expand evaluable
   arithmetic expressions.  So the call to ceiling(Number, Result) is
   equivalent to

    Result is ceiling(Number)

    which should be preferred.

   In coroutining mode, if Number is a free variable, the call to ceiling/2
   is delayed until this variable is instantiated.




Resatisfiable
      No

Fail Conditions
      Fails if the result of the evaluation does not unify with Result.



Exceptions
     4 --- Number is not instantiated (non-coroutining mode only).
     5 --- Result and Number are numbers of different types.
    24 --- Number is not of a numeric type.
    24 --- Result is neither a number nor a variable.

Examples
   
Success:
      ceiling(1.8, 2.0).
      ceiling(-1.8, -1.0).
      ceiling(5, 5).
      ceiling(-6.4, Result).      (gives Result = -6.0)
Fail:
      ceiling(0.0, 1.0).
Error:
      ceiling(A, 6.0).                   (Error 4).
      ceiling(0.5, 0).                   (Error 5).
      ceiling(1, r).                     (Error 24).
      ceiling(4 + 2.3, 6.0).             (Error 24).





See Also
   is / 2, floor / 2
