This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients MrJean1, mark.dickinson
Date 2008-06-23.12:30:16
SpamBayes Score 0.002288711
Marked as misclassified No
Message-id <1214224242.58.0.885192638488.issue3167@psf.upfronthosting.co.za>
In-reply-to
Content
Judging by the information at

http://docs.sun.com/app/docs/doc/802-1930-03/6i5u95u0i?
l=en&a=view&q=matherr

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?
History
Date User Action Args
2008-06-23 12:30:44mark.dickinsonsetspambayes_score: 0.00228871 -> 0.002288711
recipients: + mark.dickinson, MrJean1
2008-06-23 12:30:43mark.dickinsonsetspambayes_score: 0.00228871 -> 0.00228871
messageid: <1214224242.58.0.885192638488.issue3167@psf.upfronthosting.co.za>
2008-06-23 12:30:30mark.dickinsonlinkissue3167 messages
2008-06-23 12:30:28mark.dickinsoncreate