w_log10.c 851 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * ====================================================
  3. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  4. *
  5. * Developed at SunPro, a Sun Microsystems, Inc. business.
  6. * Permission to use, copy, modify, and distribute this
  7. * software is freely granted, provided that this notice
  8. * is preserved.
  9. * ====================================================
  10. */
  11. /*
  12. * wrapper log10(X)
  13. */
  14. #include "math.h"
  15. #include "math_private.h"
  16. double log10(double x) /* wrapper log10 */
  17. {
  18. #ifdef _IEEE_LIBM
  19. return __ieee754_log10(x);
  20. #else
  21. double z;
  22. z = __ieee754_log10(x);
  23. if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
  24. if(x<=0.0) {
  25. if(x==0.0)
  26. return __kernel_standard(x,x,18); /* log10(0) */
  27. else
  28. return __kernel_standard(x,x,19); /* log10(x<0) */
  29. } else
  30. return z;
  31. #endif
  32. }
  33. libm_hidden_def(log10)