w_hypotf_compat.c 958 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* w_hypotf.c -- float version of w_hypot.c.
  2. * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
  3. */
  4. /*
  5. * ====================================================
  6. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  7. *
  8. * Developed at SunPro, a Sun Microsystems, Inc. business.
  9. * Permission to use, copy, modify, and distribute this
  10. * software is freely granted, provided that this notice
  11. * is preserved.
  12. * ====================================================
  13. */
  14. /*
  15. * wrapper hypotf(x,y)
  16. */
  17. #include <math.h>
  18. #include <math_private.h>
  19. #include <math-svid-compat.h>
  20. #include <libm-alias-float.h>
  21. #if LIBM_SVID_COMPAT
  22. float
  23. __hypotf(float x, float y)
  24. {
  25. float z = __ieee754_hypotf(x,y);
  26. if(__builtin_expect(!isfinite(z), 0)
  27. && isfinite(x) && isfinite(y) && _LIB_VERSION != _IEEE_)
  28. /* hypot overflow */
  29. return __kernel_standard_f(x, y, 104);
  30. return z;
  31. }
  32. libm_alias_float (__hypot, hypot)
  33. #endif