delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/11/15:09:00

Date: Thu, 11 Jan 2001 22:05:05 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Message-Id: <9003-Thu11Jan2001220504+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp-workers AT delorie DOT com
In-reply-to: <Pine.LNX.4.10.10101111908290.10452-100000@acp3bf> (message from
Hans-Bernhard Broeker on Thu, 11 Jan 2001 19:09:45 +0100 (MET))
Subject: Re: Weird results of log( -1.0 ) with libm.a and without libm.a
(fwd)
References: <Pine DOT LNX DOT 4 DOT 10 DOT 10101111908290 DOT 10452-100000 AT acp3bf>
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

> Date: Thu, 11 Jan 2001 19:09:45 +0100 (MET)
> From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
> 
> On 11 Jan 2001, Morten Welinder wrote:
> 
> > 
> > >From Solaris man page (a generally very good source):
> > 
> >      If x is NaN, NaN is returned.
> > 
> >      If x is less than 0, -HUGE_VAL or NaN is returned and  errno
> >      is set to EDOM.
> 
> But it does not seem to tell when it will return -HUGE_VAL, and when NaN,
> does it?

I suspect that this is because different Solaris implementations (x86
and Sparc) return different values.

> Neither does the cited excerpt mention what part of this is directed by
> which external standard (ANSI, POSIX, X/Open, whatever).

According to the libm code, all versions except IEEE return
either -Inf or -HUGE, which is almost -Inf.  And libm isn't
compiled in IEEE mode by default, because that would bypass
matherr.

Amazingly enough, C99 (at least the draft) doesn't say what is the
value of log for a negative argument; it just says that EDOM _may_
occur.

So I guess this is ``unspecified behavior''.

- Raw text -


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