Print this page
11210 libm should be cstyle(1ONBLD) clean
@@ -20,10 +20,11 @@
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
+
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -63,23 +64,26 @@
#include "libm.h"
#include "longdouble.h"
long double
-cosl(long double x) {
+cosl(long double x)
+{
long double y[2], z = 0.0L;
int n, ix;
- ix = *(int *) &x; /* High word of x */
+ ix = *(int *)&x; /* High word of x */
ix &= 0x7fffffff;
- if (ix <= 0x3ffe9220) /* |x| ~< pi/4 */
+
+ if (ix <= 0x3ffe9220) { /* |x| ~< pi/4 */
return (__k_cosl(x, z));
- else if (ix >= 0x7fff0000) /* trig(Inf or NaN) is NaN */
+ } else if (ix >= 0x7fff0000) { /* trig(Inf or NaN) is NaN */
return (x - x);
- else { /* argument reduction needed */
+ } else { /* argument reduction needed */
n = __rem_pio2l(x, y);
+
switch (n & 3) {
case 0:
return (__k_cosl(y[0], y[1]));
case 1:
return (-__k_sinl(y[0], y[1]));
@@ -87,8 +91,9 @@
return (-__k_cosl(y[0], y[1]));
case 3:
return (__k_sinl(y[0], y[1]));
}
}
+
/* NOTREACHED */
- return 0.0L;
+ return (0.0L);
}