Function uu_numfmt::div_ceil[][src]

pub fn div_ceil(n: f64, d: f64) -> f64

Divide numerator by denominator, with ceiling.

If the result of the division is less than 10.0, truncate the result to the next highest tenth.

Otherwise, truncate the result to the next highest whole number.

Examples:

use uu_numfmt::div_ceil;

assert_eq!(div_ceil(1.01, 1.0), 1.1);
assert_eq!(div_ceil(999.1, 1000.), 1.0);
assert_eq!(div_ceil(1001., 10.), 101.);
assert_eq!(div_ceil(9991., 10.), 1000.);
assert_eq!(div_ceil(-12.34, 1.0), -13.0);
assert_eq!(div_ceil(1000.0, -3.14), -319.0);
assert_eq!(div_ceil(-271828.0, -271.0), 1004.0);