delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/03/22/14:20:29

Message-Id: <200003221853.NAA21885@delorie.com>
From: "Dieter Buerssner" <buers AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Date: Wed, 22 Mar 2000 19:53:50 +0100
MIME-Version: 1.0
Subject: Re: Unnormals???
References: <200003221719 DOT MAA17164 AT delorie DOT com>
In-reply-to: <Pine.LNX.4.10.10003221853480.29657-100000@acp3bf>
X-mailer: Pegasus Mail for Win32 (v3.12b)
Reply-To: djgpp-workers AT delorie DOT com

On 22 Mar 00, at 19:17, Hans-Bernhard Broeker wrote:

> I'm not entirely sure we really need to 'support' unnormals, at all,
> in this way. It think it'd make more sense to silently normalize them,
> and print what they come up as, after normalization, i.e. for an
> unnormal or pseudo-NaN, we'ld print the normalized nunber.

I think, this would be misleading. With my system, arithmetics with 
an unnormal results in a NaN. So some code like

long double unnormal;

/* produce an unnormal, perhaps by reading it from a file, or by 
thrashing some memory */

/* code doesn't work, put in a debugging printf */
printf("%Lf\n", unnormal); /* prints the renormalized number */
/* work with the number */
unnormal += 1.0;
printf("%Lf\n", unnormal); /* prints nan */

Would hide data inconsistencies longer as needed, and could make it
more difficult to find the bug. (I still like printf for debugging.)

Regards,
Dieter


- Raw text -


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