www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/01/13/15:00:39

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: Tue, 13 Jan 2004 21:55:57 +0200
From: "Eli Zaretskii" <eliz AT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: Kbwms AT aol DOT com
Message-Id: <7494-Tue13Jan2004215556+0200-eliz@elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <5f.43e4a8d9.2d356a0e@aol.com> (Kbwms@aol.com)
Subject: Re: C99 Functions Under Development and Checkout
References: <5f DOT 43e4a8d9 DOT 2d356a0e AT aol DOT com>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: Kbwms AT aol DOT com
> Date: Tue, 13 Jan 2004 10:34:38 EST
> 
> So, C99 says return a range error if the rounded result is too large,
> whereas Posix requires a domain error regardless of the kind of error.

No, C99 says a range error _may_ occur.

> Which way is the right way?  The code, written a couple of years ago,
> proceeds as follows:
> 
> If the argument is a NaN, set domain error [EDOM].  If the rounded
> result is too large (including +- Inf), set range error [ERANGE].
> In both cases, the invalid floating-point exception is raised.

Sounds okay to me, except that perhaps we should set errno to EDOM in
all these cases.

Can somebody see what does glibc do in these situations?

- Raw text -


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