bug-gnulib
[Top][All Lists]
Advanced

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

math error reporting


From: Bruno Haible
Subject: math error reporting
Date: Sun, 26 Feb 2012 14:34:34 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

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

Now I recall that we have a gnulib module 'fpieee', and with this module
the table looks like this:

   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:    NaN,           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

This means, the most natural way to report exceptional values on all
platforms is through a NaN value. This is simpler to achieve than the
<fenv.h> replacement. I'm going to write unit tests and support for this
convention in the first place.

Bruno




reply via email to

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