ceil.c 390 B

1234567891011121314151617181920
  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. #include <math.h>
  9. double
  10. ceil(double x)
  11. {
  12. double val;
  13. return modf(x, &val) > 0 ? val + 1.0 : val ;
  14. /* this also works if modf always returns a positive
  15. fractional part
  16. */
  17. }