delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/08/10/16:09:28

From: Kbwms AT aol DOT com
Message-ID: <bd.3545b77a.2c680072@aol.com>
Date: Sun, 10 Aug 2003 16:09:22 EDT
Subject: Re: Anomaly in printf()
To: djgpp-workers AT delorie DOT com
MIME-Version: 1.0
X-Mailer: 8.0 for Windows sub 6011
Reply-To: djgpp-workers AT delorie DOT com

--part1_bd.3545b77a.2c680072_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

In a message dated 8/10/2003 3:30:30 PM Eastern Standard Time, 
eliz AT elta DOT co DOT il writes:

> >Date: Sun, 10 Aug 2003 14:17:13 -0400
> >From: DJ Delorie <dj AT delorie DOT com>
> >
> >>Behold:
> >>
> >>Demo    = 18446744073709551615.000
> >>Demo - 1 = 18446744073709551613.000
> >
> >Ok, that's a bug.
> 
> Is it?  We are printing a long double, which IIRC has 19 significant
> digits.  The ``error'' here happens in the 20th digit, unless I'm
> mistaken.
> 

Incidentally, the numbers at issue here are 2^64-1, which is printed 
correctly,
and 2^64-2 which is not.

--part1_bd.3545b77a.2c680072_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">In a message dated 8/10/2003 3:30:30 PM Eastern Standard=
 Time, eliz AT elta DOT co DOT il writes:<BR>
<BR>
<BLOCKQUOTE TYPE=3DCITE style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT=
: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px"></FONT><FONT  COLOR=3D"#000000"=
 style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2 FAMILY=3D"SANSSERIF" FACE=3D"A=
rial" LANG=3D"0">&gt;Date: Sun, 10 Aug 2003 14:17:13 -0400<BR>
&gt;From: DJ Delorie &lt;dj AT delorie DOT com&gt;<BR>
&gt;<BR>
&gt;&gt;Behold:<BR>
&gt;&gt;<BR>
&gt;&gt;Demo&nbsp;&nbsp;&nbsp; =3D 18446744073709551615.000<BR>
&gt;&gt;Demo - 1 =3D 18446744073709551613.000<BR>
&gt;<BR>
&gt;Ok, that's a bug.<BR>
<BR>
Is it?&nbsp; We are printing a long double, which IIRC has 19 significant<BR=
>
digits.&nbsp; The ``error'' here happens in the 20th digit, unless I'm<BR>
mistaken.<BR>
</BLOCKQUOTE><BR>
</FONT><FONT  COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3=
 FAMILY=3D"SERIF" FACE=3D"Georgia" LANG=3D"0"><BR>
Incidentally, the numbers at issue here are 2^64-1, which is printed correct=
ly,<BR>
and 2^64-2 which is not.</FONT></HTML>

--part1_bd.3545b77a.2c680072_boundary--

- Raw text -


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