@technobuddha/library
Version:
A large library of useful functions
13 lines (12 loc) • 495 B
JavaScript
import lodash_ceil from 'lodash/ceil';
/**
* A tweaked variant of {@code Math.ceil}. See {@code goog.math.safeFloor} for
* details.
* @param input A number.
* @param precision The precision to round up to.
* @return The smallest integer greater than or equal to {@code input}.
*/
export function ceil(input, { tolerance = 0, precision = 0 } = {}) {
return lodash_ceil(input - (Math.sign(input) * tolerance) - Number.EPSILON, precision);
}
export default ceil;