|
20 | 20 | */ |
21 | 21 | /* |
22 | 22 | * Copyright 2011 Nexenta Systems, Inc. All rights reserved. |
| 23 | + * Copyright 2025 OmniOS Community Edition (OmniOSce) Association. |
23 | 24 | */ |
24 | 25 | /* |
25 | 26 | * Copyright 2005 Sun Microsystems, Inc. All rights reserved. |
@@ -120,7 +121,8 @@ static const union { |
120 | 121 | #define Inf HUGE_VAL |
121 | 122 |
|
122 | 123 | double |
123 | | -_SVID_libm_err(double x, double y, int type) { |
| 124 | +_SVID_libm_err(double x, double y, int type) |
| 125 | +{ |
124 | 126 | struct exception exc; |
125 | 127 | double t, w, ieee_retval = 0; |
126 | 128 | enum version lib_version = _lib_version; |
@@ -172,11 +174,11 @@ _SVID_libm_err(double x, double y, int type) { |
172 | 174 | exc.type = DOMAIN; |
173 | 175 | exc.name = "atan2"; |
174 | 176 | ieee_retval = copysign(1.0, x) == 1.0 ? y : |
175 | | - copysign(PI_RZ + DBL_MIN, y); |
| 177 | + copysign(PI_RZ + DBL_MIN, y); |
176 | 178 | exc.retval = 0.0; |
177 | 179 | if (lib_version == strict_ansi) { |
178 | 180 | errno = EDOM; |
179 | | - } else if (!matherr(&exc)) { |
| 181 | + } else if (lib_version != libm_ieee && !matherr(&exc)) { |
180 | 182 | if (lib_version == c_issue_4) { |
181 | 183 | (void) write(2, "atan2: DOMAIN error\n", 20); |
182 | 184 | } |
@@ -515,9 +517,9 @@ _SVID_libm_err(double x, double y, int type) { |
515 | 517 | /* INDENT OFF */ |
516 | 518 | /* |
517 | 519 | * determine if y is an odd int when x = -0 |
518 | | - * yisint = 0 ... y is not an integer |
519 | | - * yisint = 1 ... y is an odd int |
520 | | - * yisint = 2 ... y is an even int |
| 520 | + * yisint = 0 ... y is not an integer |
| 521 | + * yisint = 1 ... y is an odd int |
| 522 | + * yisint = 2 ... y is an even int |
521 | 523 | */ |
522 | 524 | /* INDENT ON */ |
523 | 525 | hx = __HI(x); |
@@ -856,7 +858,7 @@ _SVID_libm_err(double x, double y, int type) { |
856 | 858 | if (lib_version == strict_ansi) { |
857 | 859 | exc.retval = 1.0; |
858 | 860 | } else if (!matherr(&exc)) { |
859 | | - if ((lib_version == c_issue_4) || (lib_version == ansi_1)) |
| 861 | + if (lib_version == c_issue_4 || lib_version == ansi_1) |
860 | 862 | errno = EDOM; |
861 | 863 | } |
862 | 864 | break; |
@@ -948,7 +950,8 @@ _SVID_libm_err(double x, double y, int type) { |
948 | 950 | } |
949 | 951 |
|
950 | 952 | static double |
951 | | -setexception(int n, double x) { |
| 953 | +setexception(int n, double x) |
| 954 | +{ |
952 | 955 | /* |
953 | 956 | * n = |
954 | 957 | * 0 division by zero |
|
0 commit comments