From: Kbwms AT aol DOT com Message-ID: <1cd.f004ee0.2c694063@aol.com> Date: Mon, 11 Aug 2003 14:54:27 EDT Subject: Re: Anomaly in printf() To: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="part1_1cd.f004ee0.2c694063_boundary" X-Mailer: 8.0 for Windows sub 6011 Reply-To: djgpp-workers AT delorie DOT com --part1_1cd.f004ee0.2c694063_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 8/11/2003 2:12:53 PM Eastern Standard Time, eliz AT elta DOT co DOT il writes: > . The closest long double to (unsigned long long)(-1) is > 18446744073709551613.75; > > But, (unsigned long long)(-1) prints out correctly based on my original demo program: #include int main(void) { long double Demo = (unsigned long long)(-1); printf("Demo = %.3Lf\n", Demo); printf("Demo - 1 = %.3Lf\n", Demo-1.0L); exit(0); } --part1_1cd.f004ee0.2c694063_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable In a message dated 8/11/2003 2:12:53 PM Eastern Standard= Time, eliz AT elta DOT co DOT il writes:

. The closest long double to (unsigned long long)(-1) is   18446744073709551613.75;



But, (unsigned long long)(-1) prints out correctly based on my original demo= program:

#include <stdio.h>

int
main(void)
{
    long double Demo =3D (unsigned long long)(-1);

    printf("Demo     =3D %.3Lf\n", Demo);=
    printf("Demo - 1 =3D %.3Lf\n", Demo-1.0L);
    exit(0);
}
--part1_1cd.f004ee0.2c694063_boundary--