/* @(#)s_floor.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
/*
* floor(x)
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
* Exception:
* Inexact flag raised if x not equal to floor(x).
*/
#include "math.h"
#include "math_private.h"
double
floor(double x)
{
u_int32_t i,j;
if(j0<20) {
if(j0<0) { /* raise inexact if x != 0 */
}
} else {
i = (0x000fffff)>>j0;
}
}
} else if (j0>51) {
else return x; /* x is integral */
} else {
if((i1&i)==0) return x; /* x is integral */
if(i0<0) {
else {
i1=j;
}
}
i1 &= (~i);
}
}
return x;
}