Commit b9b19ea2 authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Use the __rem_pio2()/__rem_pio2f() implementation from the bundled musl library.

parent 8252be56
......@@ -119,7 +119,7 @@ int __rem_pio2(double x, double *y)
if (ix < 0x413921fb) { /* |x| ~< 2^20*(pi/2), medium size */
medium:
/* rint(x/(pi/2)) */
fn = (double_t)x*invpio2 + toint - toint;
fn = rint(x * invpio2);
n = (int32_t)fn;
r = x - fn*pio2_1;
w = fn*pio2_1t; /* 1st round, good to 85 bits */
......
......@@ -52,7 +52,7 @@ int __rem_pio2f(float x, double *y)
/* 25+53 bit pi is good enough for medium size */
if (ix < 0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */
/* Use a specialized rint() to get fn. */
fn = (double_t)x*invpio2 + toint - toint;
fn = fp_barrier(x * invpio2 + toint) - toint;
n = (int32_t)fn;
*y = x - fn*pio2_1 - fn*pio2_1t;
/* Matters with directed rounding. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment