/* @(#)s_modf.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#include <LibConfig.h>
#include <sys/EfiCdefs.h>
#endif
/*
* modf(double x, double *iptr)
* return fraction part of x, and return x's integral part in *iptr.
* Method:
* Bit twiddling.
*
* Exception:
* No exception.
*/
#include "math.h"
#include "math_private.h"
double
{
u_int32_t i;
if(j0<0) { /* |x|<1 */
return x;
} else {
i = (0x000fffff)>>j0;
*iptr = x;
GET_HIGH_WORD(high,x);
return x;
} else {
return x - *iptr;
}
}
GET_HIGH_WORD(high,x);
return x;
} else { /* fraction part in low x */
if((i1&i)==0) { /* x is integral */
*iptr = x;
GET_HIGH_WORD(high,x);
return x;
} else {
return x - *iptr;
}
}
}