ceil.c 399 B

123456789101112131415161718192021
  1. /*
  2. * (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. *
  5. * Author: Ceriel J.H. Jacobs
  6. */
  7. /* $Id$ */
  8. double
  9. ceil(x)
  10. double x;
  11. {
  12. extern double modf();
  13. double val;
  14. return modf(x, &val) > 0 ? val + 1.0 : val ;
  15. /* this also works if modf always returns a positive
  16. fractional part
  17. */
  18. }