Mail Archives: djgpp-workers/2001/01/11/15:09:00
> 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 -