X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f From: Kbwms AT aol DOT com Message-ID: Date: Sun, 28 Sep 2003 09:18:06 EDT Subject: Fwd: Bug in modfl() in libc.a To: rich AT phekda DOT freeserve DOT co DOT uk (Rich Dawe) CC: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="part1_d0.3f496250.2ca8398e_boundary" X-Mailer: 8.0 for Windows sub 6015 Reply-To: djgpp-workers AT delorie DOT com --part1_d0.3f496250.2ca8398e_boundary Content-Type: multipart/alternative; boundary="part1_d0.3f496250.2ca8398e_alt_boundary" --part1_d0.3f496250.2ca8398e_alt_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 9/28/2003 8:01:27 AM Eastern Standard Time, rich AT phekda DOT freeserve DOT co DOT uk writes: > * modfl not integrated. > - DJGPP already has modfl. > Please install the patch that fixes the problem already reported in the forwarded report. As it stands, the current version fails the test in the math test suite. KB Williams --part1_d0.3f496250.2ca8398e_alt_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable In a message dated 9/28/2003 8:01:27 AM Eastern Standard= Time, rich AT phekda DOT freeserve DOT co DOT uk writes:

* modfl not integrated.
- DJGPP already has modfl.


Please install the patch that fixes the problem already reported in the forw= arded report.  As it stands, the current version fails the test in the=20= math test suite.


KB Williams
--part1_d0.3f496250.2ca8398e_alt_boundary-- --part1_d0.3f496250.2ca8398e_boundary Content-Type: message/rfc822 Content-Disposition: inline Return-path: From: Kbwms AT aol DOT com Full-name: Kbwms Message-ID: <163 DOT 2566e055 DOT 2c8f7691 AT aol DOT com> Date: Tue, 9 Sep 2003 14:31:45 EDT Subject: Bug in modfl() in libc.a To: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="part2_d0.3f496250.2c8f7691_boundary" X-Mailer: 8.0 for Windows sub 6015 --part2_d0.3f496250.2c8f7691_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit As results from the demo program below show, there is a bug in the version of function modfl() that resides in libc.a. Results from libc and our new long double math library are displayed. #include long double modfl(long double, long double *); int main(void) { const long double Infinity = (1.0L/0.0L); long double Argument, FracPart, IntPart; FracPart = modfl(+Infinity, &IntPart); printf("modfl(%+Lg, &IntPart): FracPart = %+Lg, IntPart = %+Lg\n", +Infinity, FracPart, IntPart); FracPart = modfl(-Infinity, &IntPart); printf("modfl(%+Lg, &IntPart): FracPart = %+Lg, IntPart = %+Lg\n", -Infinity, FracPart, IntPart); exit(0); } According to paragraph F.9.3.12 of ISO/IEC 9899:1999 (E), -- modfl(+-Infinity, iptr) returns +-0 and stores +-Infinity in the in the object pointed to by iptr modfl in libc.a: --------------- modfl(+Inf, &IntPart): FracPart = -NaN, IntPart = +Inf modfl(-Inf, &IntPart): FracPart = -NaN, IntPart = -Inf ======================================== modfl in new long double math library: --------------------------------------- modfl(+Inf, &IntPart): FracPart = +0, IntPart = +Inf modfl(-Inf, &IntPart): FracPart = -0, IntPart = -Inf KB Williams --part2_d0.3f496250.2c8f7691_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable As results from the demo program below show, there is a=20= bug in the version of function modfl() that resides in libc.a.  Results= from libc and our new long double math library are displayed.


#include <stdio.h>
long double modfl(long double, long double *);
int
main(void)
{
    const long double Infinity =3D (1.0L/0.0L);
    long double Argument, FracPart, IntPart;

    FracPart =3D modfl(+Infinity, &IntPart);
    printf("modfl(%+Lg, &IntPart): FracPart =3D %+Lg, Int= Part =3D %+Lg\n",
    +Infinity, FracPart, IntPart);

    FracPart =3D modfl(-Infinity, &IntPart);
    printf("modfl(%+Lg, &IntPart): FracPart =3D %+Lg, Int= Part =3D %+Lg\n",
    -Infinity, FracPart, IntPart);
    exit(0);
}

According to paragraph F.9.3.12 of ISO/IEC 9899:1999 (E),

-- modfl(+-Infinity, iptr) returns +-0 and stores +-Infinity in the
      in the object pointed to by iptr

modfl in libc.a:
---------------
modfl(+Inf, &IntPart): FracPart =3D -NaN, IntPart =3D +Inf
modfl(-Inf, &IntPart): FracPart =3D -NaN, IntPart =3D -Inf

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

modfl in new long double math library:
---------------------------------------
modfl(+Inf, &IntPart): FracPart =3D +0, IntPart =3D +Inf
modfl(-Inf, &IntPart): FracPart =3D -0, IntPart =3D -Inf


KB Williams
--part2_d0.3f496250.2c8f7691_boundary-- --part1_d0.3f496250.2ca8398e_boundary--