Skip to main content

ceiling_math

Function ceiling_math 

Source
pub fn ceiling_math<A: Number>(number: A) -> FnNumber1<A>
Expand description

Rounds a number to the nearest multiple of a significance value. In most cases, the number is rounded up (toward +∞). However, a mode parameter is provided and when this is set to a non-zero value, then negative numbers are rounded down (toward -∞).

documentfoundation->CEILING.MATH

Syntax:

    CEILING.MATH( Number: Number )

Info2: Returns a real number that is the rounded value and is an integer multiple of the significance value.

Semantics:

Number is a real number, or a reference to a cell containing that number, that is the value to be rounded.

Significance is a real number, or a reference to a cell containing that number, that is the significance value to be used. If omitted, Significance defaults to 1. The sign of Significance is ignored.

Mode is a real number, or a reference to a cell containing that number, that is a Boolean mode indicator. Mode is only effective when Number is negative. If Mode is present and equal to any non-zero value (including TRUE), negative numbers are rounded down (toward -∞). If Mode is omitted, or equal to zero or FALSE, negative numbers are rounded up (toward +∞).

If any argument is non-numeric, then CEILING.MATH reports a #VALUE! error. If either Number or Significance is equal to 0, then CEILING.MATH returns 0.

Info: Details specific to CEILING.MATH function

With Significance set to -1 or +1, or defaulted to 1, and Mode set or defaulted to 0 or FALSE, CEILING.MATH provides functionality that implements the standard mathematical definition of a ceiling value.

CEILING.MATH is similar to the CEILING function, the difference between the two lying in the interpretation of the Significance argument. The CEILING function requires the Significance and Number arguments to have the same sign, whereas for CEILING.MATH the sign of the Significance argument is ignored.

See also: crate::of::ceiling_math_(), crate::of::ceiling_math__(),