Author mark.dickinson
Recipients MrJean1, mark.dickinson
Date 2008-06-23.12:30:16
SpamBayes Score 0.00228871
Marked as misclassified No
Message-id <>
Judging by the information at

this behaviour is intentional.  It looks like log(-inf)
sets errno = EDOM and returns -inf.  An IEEE 754
conforming math library would return NaN instead.

I've no idea why the 64-bit build doesn't exhibit
this problem.

math_1 in Modules/mathmodule.c bases its error reporting
primarily on return values, only looking at errno in the
case when a finite value is returned.  So it doesn't
ever take any notice of the EDOM errno value.

Unfortunately, changing this would likely cause failures
on other machines.  GNU libc is all over the place when
it comes to setting errno:  I recall finding that on one
Linux machine, of the three calls atanh(1.), log(0.) and
log10(0.), one of these sets errno = EDOM, one sets errno
= ERANGE, and one doesn't set errno at all.  (All three
calls correspond to logarithmic singularities, and should
all behave the same way.)

One obvious solution is to write a matherr function
for use on Solaris, as described on the man page
above.  Do you think you could have a
go at this?
Date User Action Args
2008-06-23 12:30:44mark.dickinsonsetspambayes_score: 0.00228871 -> 0.00228871
recipients: + mark.dickinson, MrJean1
2008-06-23 12:30:43mark.dickinsonsetspambayes_score: 0.00228871 -> 0.00228871
messageid: <>
2008-06-23 12:30:30mark.dickinsonlinkissue3167 messages
2008-06-23 12:30:28mark.dickinsoncreate