Re: math error reporting

2012-03-12 Thread Bruno Haible
Bastien ROUCARIES wrote (about the 'errno' convention for math functions): > > 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... A doc patch is welco

Re: math error reporting

2012-03-12 Thread Bastien ROUCARIES
On Mon, Mar 12, 2012 at 12:47 PM, Bruno Haible wrote: >> In November 2011, I wrote in >> : >> >>    glibc 2.11:   NaN, fenv bit, errno >>    MacOS X 10.5: NaN, fenv bit          math_errhandling >> (always=MATH_ERREXCEPT) >>    F

Re: math error reporting

2012-03-12 Thread Bruno Haible
> In November 2011, I wrote in > : > >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 > (alwa

remainder math error reporting

2012-02-27 Thread Bruno Haible
Similarly, the modules remainder remainderf remainderl don't pass the test suite with IEEE compliance on OSF/1 5.1: test-remainder-ieee.h:30: assertion failed FAIL: test-remainder-ieee test-remainder-ieee.h:30: assertion failed FAIL: test-remainderf-ieee test-remainder-ieee.h:30: assertion f

fmod* math error reporting

2012-02-27 Thread Bruno Haible
The fmod* functions also have portability problems regarding proper IEEE behaviour: * fmod OSF/1 5.1: test-fmod-ieee.h:30: assertion failed mingw: test-fmod-ieee.h:48: assertion failed MSVC 9:test-fmod-ieee.h:48: assertion failed * fmodf OSF/1 5.1: test-fmod-ieee.h:30: assertion failed MS

modfl math error reporting

2012-02-26 Thread Bruno Haible
The test-modfl-ieee test also fails. The gnulib replacement code is one of the culprits, and other than that: IRIX 6.5test-modf-ieee.h:35: assertion failed OSF/1 5.1 test-modf-ieee.h:43: assertion failed mingw test-modf-ieee.h:43: assertion failed Three fixes make it all work. 2012-

modff math error reporting

2012-02-26 Thread Bruno Haible
> After I wrote NaN and Inf tests for the modf() function, the test-modf-ieee > test fails on some platforms: Similarly with the test-modff-ieee test: Solaris 9 crash in call at line test-modf-ieee.h:25 Cygwin 1.7.9 test-modf-ieee.h:27: assertion failed NetBSD 5.1 test-modf-ieee.h:27: a

modf math error reporting

2012-02-26 Thread Bruno Haible
After I wrote NaN and Inf tests for the modf() function, the test-modf-ieee test fails on some platforms: Cygwin 1.7.9 test-modf-ieee.h:27: assertion failed IRIX 6.5 test-modf-ieee.h:35: assertion failed FreeBSD 6.4test-modf-ieee.h:35: assertion failed NetBSD 5.1 test-modf-ieee.h:2

math error reporting

2012-02-26 Thread Bruno Haible
In November 2011, I wrote in : 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)

Re: math error reporting

2011-11-07 Thread Bruno Haible
Bastien ROUCARIES wrote: > msvc is compliant but a the microsoft taste > https://www.securecoding.cert.org/confluence/display/seccode/FLP03-C.+Detect+and+handle+floating+point+errors Thanks, this was helpful. I wasn't aware of this _controlfp_s function. Bruno -- In memoriam Hannah Szenes

Re: math error reporting

2011-11-07 Thread Bastien ROUCARIES
On Sun, Nov 6, 2011 at 8:36 PM, Bruno Haible wrote: > Hi, > > Considering how gnulib-implemented functions should do their > error reporting, I ran a test program to see how the various systems > implement math errors. > > ==

Re: math error reporting

2011-11-07 Thread Bruno Haible
>OSF/1 5.1:0, errno ( incomplete) With the module 'fpieee', this becomes OSF/1 5.1:NaN, errno ( incomplete) So, we are able to support IEEE NaN on all platforms. Bruno -- In memoriam Hannah Szenes

Re: math error reporting

2011-11-06 Thread Bruno Haible
Paul Eggert wrote: > > How does that sound? (It's a lot of work, I know.) > > It sounds nice. You're right that it's a lot of work, though. > Is it worth the effort? (Depends on the problem you want solved > but I don't know what that is) The problem is that the way to test whether a math f

Re: math error reporting

2011-11-06 Thread Paul Eggert
On 11/06/11 12:36, Bruno Haible wrote: > How does that sound? (It's a lot of work, I know.) It sounds nice. You're right that it's a lot of work, though. Is it worth the effort? (Depends on the problem you want solved but I don't know what that is) Will the replacement address the document

math error reporting

2011-11-06 Thread Bruno Haible
Hi, Considering how gnulib-implemented functions should do their error reporting, I ran a test program to see how the various systems implement math errors. #include #include #include #ifndef NO_FENV #include #endif