Ramda Adjunct 3.0.0

ceil.js

  1. import { bind, curryN } from 'ramda';
  2. /**
  3. * Returns the smallest integer greater than or equal to a given number.
  4. *
  5. * Note: ceil(null) returns integer 0 and does not give a NaN error.
  6. *
  7. * @func ceil
  8. * @memberOf RA
  9. * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
  10. * @category Math
  11. * @sig Number -> Number
  12. * @param {number} number The number to ceil
  13. * @return {number} The smallest integer greater than or equal to the given number
  14. * @example
  15. *
  16. * RA.ceil(.95); //=> 1
  17. * RA.ceil(4); //=> 4
  18. * RA.ceil(7.004); //=> 8
  19. * RA.ceil(-0.95); //=> -0
  20. * RA.ceil(-4); //=> -4
  21. * RA.ceil(-7.004); //=> -7
  22. * RA.ceil(null); //=> 0
  23. */
  24. const ceil = curryN(1, bind(Math.ceil, Math));
  25. export default ceil;