Rev | Line | |
---|
[1] | 1 | |
---|
| 2 | /* @(#)w_atan2.c 5.1 93/09/24 */ |
---|
| 3 | /* |
---|
| 4 | * ==================================================== |
---|
| 5 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
---|
| 6 | * |
---|
| 7 | * Developed at SunPro, a Sun Microsystems, Inc. business. |
---|
| 8 | * Permission to use, copy, modify, and distribute this |
---|
| 9 | * software is freely granted, provided that this notice |
---|
| 10 | * is preserved. |
---|
| 11 | * ==================================================== |
---|
| 12 | * |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | /* |
---|
| 16 | * wrapper atan2(y,x) |
---|
| 17 | */ |
---|
| 18 | |
---|
| 19 | #include <libm/fdlibm.h> |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | #ifdef __STDC__ |
---|
| 23 | double atan2(double y, double x) /* wrapper atan2 */ |
---|
| 24 | #else |
---|
| 25 | double atan2(y,x) /* wrapper atan2 */ |
---|
| 26 | double y,x; |
---|
| 27 | #endif |
---|
| 28 | { |
---|
| 29 | #ifdef _IEEE_LIBM |
---|
| 30 | return __ieee754_atan2(y,x); |
---|
| 31 | #else |
---|
| 32 | double z; |
---|
| 33 | z = __ieee754_atan2(y,x); |
---|
| 34 | if(_LIB_VERSION == _IEEE_||isnan(x)||isnan(y)) return z; |
---|
| 35 | if(x==0.0&&y==0.0) { |
---|
| 36 | return __kernel_standard(y,x,3); /* atan2(+-0,+-0) */ |
---|
| 37 | } else |
---|
| 38 | return z; |
---|
| 39 | #endif |
---|
| 40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.