Print this page
11210 libm should be cstyle(1ONBLD) clean
*** 20,29 ****
--- 20,30 ----
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
+
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
*** 43,69 ****
*/
#include "libm.h"
double
! __modf(double x, double *iptr) {
union {
unsigned i[2];
double d;
} xx, yy;
unsigned hx, s;
xx.d = x;
hx = xx.i[HIWORD] & ~0x80000000;
if (hx >= 0x43300000) { /* x is NaN, infinite, or integral */
*iptr = x;
! if (hx < 0x7ff00000 || (hx == 0x7ff00000 &&
! xx.i[LOWORD] == 0)) {
xx.i[HIWORD] &= 0x80000000;
xx.i[LOWORD] = 0;
}
return (xx.d);
}
if (hx < 0x3ff00000) { /* |x| < 1 */
xx.i[HIWORD] &= 0x80000000;
--- 44,74 ----
*/
#include "libm.h"
double
! __modf(double x, double *iptr)
! {
union {
unsigned i[2];
double d;
} xx, yy;
+
unsigned hx, s;
xx.d = x;
hx = xx.i[HIWORD] & ~0x80000000;
if (hx >= 0x43300000) { /* x is NaN, infinite, or integral */
*iptr = x;
!
! if (hx < 0x7ff00000 || (hx == 0x7ff00000 && xx.i[LOWORD] ==
! 0)) {
xx.i[HIWORD] &= 0x80000000;
xx.i[LOWORD] = 0;
}
+
return (xx.d);
}
if (hx < 0x3ff00000) { /* |x| < 1 */
xx.i[HIWORD] &= 0x80000000;
*** 72,90 ****
--- 77,97 ----
return (x);
}
/* split x at the binary point */
s = xx.i[HIWORD] & 0x80000000;
+
if (hx < 0x41400000) {
yy.i[HIWORD] = xx.i[HIWORD] & ~((1 << (0x413 - (hx >> 20))) -
1);
yy.i[LOWORD] = 0;
} else {
yy.i[HIWORD] = xx.i[HIWORD];
yy.i[LOWORD] = xx.i[LOWORD] & ~((1 << (0x433 - (hx >> 20))) -
1);
}
+
*iptr = yy.d;
xx.d -= yy.d;
xx.i[HIWORD] = (xx.i[HIWORD] & ~0x80000000) | s;
/* keep sign of x */
return (xx.d);