log10.c 393 B

123456789101112131415161718192021222324252627
  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. #include <errno.h>
  10. extern int errno;
  11. double
  12. log10(x)
  13. double x;
  14. {
  15. extern double log();
  16. if (x <= 0) {
  17. errno = EDOM;
  18. return 0;
  19. }
  20. return log(x) / M_LN10;
  21. }