<-- Previous || Up || Next -->

Ceiling Function
Math Reals Class

Public Function Ceiling( _
      ByVal vNumber As Variant _
    , Optional ByVal vPrecision As Variant _
    ) As Variant

Ceiling of a real number.
Number vNumber is rounded-up with precision vPrecision.

Examples:
    Ceiling(2.4) = 3
    Ceiling(2) = 2
    Ceiling(.6) = 1
    Ceiling(0) = 0
    Ceiling(-.6) = 0
    Ceiling(-2) = -2
    Ceiling(-2.4) = -2
    Ceiling(-1.4, .5) = -1
    Ceiling(-1.7, .5) = -1.5
See also:
    CeilingVerify Subroutine
    Floor Function
    RoundToPrecision Function
    NextNumber Function
vNumber: The number that is to be rounded-up. Function returns Null if vNumber is Null or cannot be fixed up to a number.

vPrecision: The precision used when rounding vNumber. vPrecision defaults to 1 (one) if it is missing or Null or cannot be fixed up to a number.
Note: With a precision of 1 (one), function returns the smallest integer greater than or equal to vNumber.

Definition:

    Ceiling(X, Y) = - Floor(-X, Y)

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.