delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/09/01/15:57:19

From: Kbwms AT aol DOT com
Message-ID: <1d0.1025156e.2c84fe96@aol.com>
Date: Mon, 1 Sep 2003 15:57:10 EDT
Subject: Bug in modfl() in libc.a
To: djgpp-workers AT delorie DOT com
MIME-Version: 1.0
X-Mailer: 8.0 for Windows sub 6015
Reply-To: djgpp-workers AT delorie DOT com

--part1_1d0.1025156e.2c84fe96_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

There is a version of modfl() in libc that produces incorrect results when 
the argument is infinity:

Test using modfl in libc.a
------------TEST   1------------
modfl(+Inf, &IntPart) : Func = -NaN, IntPart = +Inf                
modfl(-Inf, &IntPart) : Func = -NaN, IntPart = -Inf                

C99 calls for the integer output to be infinity and the function value to be 
a zero with the same sign as the argument, as in:

Test using modfl in libongdbl.a
------------TEST   2------------
modfl(+Inf, &IntPart) : Func = +0, IntPart = +Inf                
modfl(-Inf, &IntPart)  : Func = -0, IntPart = -Inf                


KB Williams

--part1_1d0.1025156e.2c84fe96_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><FONT FACE=3Darial,helvetica><FONT  SIZE=3D3 FAMILY=3D"SERIF" FACE=3D"=
Georgia" LANG=3D"0">There is a version of modfl() in libc that produces inco=
rrect results when the argument is infinity:<BR>
<BR>
Test using modfl in libc.a<BR>
------------TEST&nbsp;&nbsp; 1------------<BR>
modfl(+Inf, &amp;IntPart) : Func =3D -NaN, IntPart =3D +Inf&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B=
R>
modfl(-Inf, &amp;IntPart) : Func =3D -NaN, IntPart =3D -Inf&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B=
R>
<BR>
C99 calls for the integer output to be infinity and the function value to be=
 a zero with the same sign as the argument, as in:<BR>
<BR>
Test using modfl in libongdbl.a<BR>
------------TEST&nbsp;&nbsp; 2------------<BR>
modfl(+Inf, &amp;IntPart) : Func =3D +0, IntPart =3D +Inf&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>
modfl(-Inf, &amp;IntPart)&nbsp; : Func =3D -0, IntPart =3D -Inf&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; <BR>
<BR>
<BR>
KB Williams<BR>
</FONT></HTML>
--part1_1d0.1025156e.2c84fe96_boundary--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019