delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/09/09/17:10:37

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3F5E2712.9E8C2E1F@phekda.freeserve.co.uk>
Date: Tue, 09 Sep 2003 20:16:34 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com, peuha AT cc DOT helsinki DOT fi
Subject: Re: Anomaly in printf()
References: <a DOT 354a4585 DOT 2c8f52cf AT aol DOT com>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Kbwms AT aol DOT com wrote:
> Esa Peuha, student of mathematics at the University of Helsinki:

You might be wondering what K. B. Williams is talking about. Esa: I sent him
the patch you made to _doprnt to fix the problems in the accuracy of its
output. It looks like it worked. ;)

Bye, Rich =]

> Nice going, as the examples below show:
> 
> #include <stdio.h>
> int
> main(void)
> {
>     long double    Demo = (unsigned long long)(-1);
> 
>     printf("Demo     = %.0Lf\n", Demo);
>     printf("Demo - 1 = %.0Lf\n", Demo-1.0L);
>     printf("Demo - 2 = %.0Lf\n", Demo-2.0L);
>     exit(0);
> }
> 
> Current _doprnt.o:
> 
> Demo     = 18446744073709551615
> Demo - 1 = 18446744073709551613
> Demo - 2 = 18446744073709551613
> 
> Improved _doprnt.o:
> 
> Demo     = 18446744073709551615
> Demo - 1 = 18446744073709551614
> Demo - 2 = 18446744073709551613
> 
> KB Williams

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


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