bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: math error reporting


From: Bastien ROUCARIES
Subject: Re: math error reporting
Date: Mon, 12 Mar 2012 13:24:16 +0100

On Mon, Mar 12, 2012 at 12:47 PM, Bruno Haible <address@hidden> wrote:
>> In November 2011, I wrote in
>> <http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00069.html>:
>>
>>    glibc 2.11:   NaN, fenv bit, errno
>>    MacOS X 10.5: NaN, fenv bit          math_errhandling 
>> (always=MATH_ERREXCEPT)
>>    FreeBSD 6.4:  NaN, fenv bit          math_errhandling 
>> (always=MATH_ERREXCEPT)
>>    OpenBSD 4.9:  NaN
>>    NetBSD 5.1:   NaN,           errno
>>    AIX 7.1:      NaN, fenv bit, errno   math_errhandling (always=MATH_ERRNO)
>>    HP-UX 11.31:  NaN, fenv bit, errno
>>    IRIX 6.5:     NaN
>>    OSF/1 5.1:    0,             errno   (<fenv.h> incomplete)
>>    Solaris 10:   NaN, fenv bit, errno   math_errhandling 
>> (always=MATH_ERREXCEPT)
>>    Cygwin 1.7.9: NaN,           errno
>>    mingw:        NaN, fenv bit, errno
>>    MSVC 9:       NaN,           errno
>
> Actually glibc does not support the 'errno' convention really.
> See this list of bugs: [1]
> The following are still open:
> 6796 fdim() does not set errno on overflow
> 6785 erf() does not set errno for underflow
> 6793 logb() does not set errno on pole error
> 6804 scalb() does not set errno on domain error
> 6808 yn() does not set errno for overflow error.
> 6802 remquo() does not set errno on domain error
> 6792 log1p() does not set errno n error
> 6801 fma() does not ser errno for various errors
> 6797 lround() and llround() do not set errno on domain error
> 6786 erfc() does not set errno for underflow
> 6798 lrint() and llrint() do not set errno on domain error
> 6810 tgamma() does not set errno for underflow error
> 6809 tgamma() sets errno inconsistently for domain error
> 6795 hypot() does not set errno consistently on error
> 6787 exp10() does not consistently set errno
> 6799 nextafter() and nexttoward() doen't set errno on overflow/underflow 
> errors
> 6807 y0(), y1(), yn() do not raise exception and give wrong errno for pole 
> error
> 6794 ilogb() does not raise exceptions or set errno on domain errors
> 6803 scalb(), scalbln(), scalbn() do not set errno on overflow/underflow
> 6805 j0(), j1(), jn() do not raise exceptions on underflow error
> 6806 y0(), y1(), yn() do not raise exception on underflow
>
> If glibc does not support this error reporting convention, I think there's
> not much point for gnulib to do it.

We must a least document it. I have been beaten by y0 underflow a few times...

>
> Btw, a side note about the "fenv bit" convention:
>  1) "inexact" and "underflow" exceptions cannot be taken seriously
>     because Joseph Myers sais [2]:
>       "C99 and C11 permit spurious underflow exceptions (as well as
>        spurious inexact exceptions, and raising inexact even when
>        the result is exact)."
>  2) glibc has some open bugs in this area as well: [3]

1) is a quality of implementation bug and should be closed.
2) will try to submit paches

Bastien

> Bruno
>
> [1] 
> http://sourceware.org/bugzilla/buglist.cgi?query_format=specific&order=relevance%20desc&bug_status=__all__&content=math%20errno&list_id=3078
> [2] http://sourceware.org/bugzilla/show_bug.cgi?id=6778
> [3] http://sourceware.org/bugzilla/show_bug.cgi?id=13787
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]