w_atan2.c 879 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* @(#)w_atan2.c 1.3 95/01/18 */
  2. /*
  3. * ====================================================
  4. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  5. *
  6. * Developed at SunSoft, a Sun Microsystems, Inc. business.
  7. * Permission to use, copy, modify, and distribute this
  8. * software is freely granted, provided that this notice
  9. * is preserved.
  10. * ====================================================
  11. *
  12. */
  13. /*
  14. * wrapper atan2(y,x)
  15. */
  16. #include "fdlibm.h"
  17. #ifdef __STDC__
  18. double atan2(double y, double x) /* wrapper atan2 */
  19. #else
  20. double atan2(y,x) /* wrapper atan2 */
  21. double y,x;
  22. #endif
  23. {
  24. #ifdef _IEEE_LIBM
  25. return __ieee754_atan2(y,x);
  26. #else
  27. double z;
  28. z = __ieee754_atan2(y,x);
  29. if(_LIB_VERSION == _IEEE_||isnan(x)||isnan(y)) return z;
  30. if(x==0.0&&y==0.0) {
  31. return __kernel_standard(y,x,3); /* atan2(+-0,+-0) */
  32. } else
  33. return z;
  34. #endif
  35. }