Jan Stary schreef op 2017-09-27 00:45:
The int32_t float word of M_PI_4 is 0x3f490fdb, not 0x3f490fd8.

What bug are you trying to fix?

On Sep 26 11:57:29, [email protected] wrote:
On 2017-09-26 11:41 AM, Jan Stary wrote:
>    double 0.785398, high  word 0x3fe921fb
>    float  0.785398, float word 0x3f490fdb
>
> In case of double, it's exactly 0x3fe921fb.
> But why then does s_sinf.c use 0x3f490fd8 instead of 0x3f490fdb?
>
Educated guess? Because 8 and upper-case B look alike when you've had too
much beer or when you left your reading glasses in the car.

Index: s_sinf.c
===================================================================
RCS file: /cvs/src/lib/libm/src/s_sinf.c,v
retrieving revision 1.4
diff -u -p -r1.4 s_sinf.c
--- s_sinf.c    12 Sep 2016 19:47:02 -0000      1.4
+++ s_sinf.c    26 Sep 2017 22:42:26 -0000
@@ -26,7 +26,7 @@ sinf(float x)

     /* |x| ~< pi/4 */
        ix &= 0x7fffffff;
-       if(ix <= 0x3f490fd8) return __kernel_sinf(x,z,0);
+       if(ix <= 0x3f490fdb) return __kernel_sinf(x,z,0);

     /* sin(Inf or NaN) is NaN */
        else if (ix>=0x7f800000) return x-x;
Index: s_cosf.c
===================================================================
RCS file: /cvs/src/lib/libm/src/s_cosf.c,v
retrieving revision 1.5
diff -u -p -r1.5 s_cosf.c
--- s_cosf.c    12 Sep 2016 19:47:02 -0000      1.5
+++ s_cosf.c    26 Sep 2017 22:42:26 -0000
@@ -26,7 +26,7 @@ cosf(float x)

     /* |x| ~< pi/4 */
        ix &= 0x7fffffff;
-       if(ix <= 0x3f490fd8) return __kernel_cosf(x,z);
+       if(ix <= 0x3f490fdb) return __kernel_cosf(x,z);

     /* cos(Inf or NaN) is NaN */
        else if (ix>=0x7f800000) return x-x;

Reply via email to