From: Kbwms AT aol DOT com Message-ID: 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 Content-Type: multipart/alternative; boundary="part1_bd.3545b77a.2c680072_boundary" 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 > > > >>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 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    =3D 18446744073709551615.000
>>Demo - 1 =3D 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 correct= ly,
and 2^64-2 which is not.
--part1_bd.3545b77a.2c680072_boundary--