added xmul2f and xdiv2f to sleef.c

This commit is contained in:
Ingo
2013-03-24 23:26:22 +01:00
parent 9abc66ba8f
commit 0e194b1597

View File

@@ -1212,4 +1212,18 @@ __inline float xexpf(float d) {
// if (xisminff(d)) u = 0;
return u;
}
__inline float xmul2f(float d) {
if (*(int*)&d & 0x7FFFFFFF) { // if f==0 do nothing
*(int*)&d += 1 << 23; // add 1 to the exponent
}
return d;
}
__inline float xdiv2f(float d) {
if (*(int*)&d & 0x7FFFFFFF) { // if f==0 do nothing
*(int*)&d -= 1 << 23; // sub 1 from the exponent
}
return d;
}
#endif