[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strtod bugs
From: |
Eric Blake |
Subject: |
Re: strtod bugs |
Date: |
Mon, 31 Mar 2008 13:22:30 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Jim Meyering on 3/31/2008 11:24 AM:
|
| Actually, strtod is doing the right thing: it produces -0,
| with both the libc version and the gnulib-supplied function.
|
| The trouble is that signbit(result) returns INT_MIN,
| while signbit(-0.0) returns 1. Both seem to be allowed, so
| how about this change? It solves the problem for me.
Good catch. Yes, signbit is allowed to return any non-zero value when the
argument is negative, so your patch looks correct. However,
| + ASSERT (!!signbit (result) == !!signbit (-(double)0.0)); /* IRIX 6.5 */
Any reason you added the cast to double here?
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkfxOfYACgkQ84KuGfSFAYCcjgCdEa4rze1q7dwvbglVzFPvXThw
LY0AnjpQUS0FHsCShAjT1PDBV0tx+ran
=qIiJ
-----END PGP SIGNATURE-----
- strtod bugs, Eric Blake, 2008/03/29
- Re: strtod bugs, Eric Blake, 2008/03/29
- Re: strtod bugs, Jim Meyering, 2008/03/30
- Re: strtod bugs, Jim Meyering, 2008/03/30
- Re: strtod bugs, Eric Blake, 2008/03/30
- Re: strtod bugs, Jim Meyering, 2008/03/30
- Re: strtod bugs, Eric Blake, 2008/03/30
- Re: strtod bugs, Eric Blake, 2008/03/30
- Re: strtod bugs, Jim Meyering, 2008/03/31
- Re: strtod bugs,
Eric Blake <=
- Re: strtod bugs, Eric Blake, 2008/03/31
- Re: strtod bugs, Bruno Haible, 2008/03/31
- Re: strtod bugs, Jim Meyering, 2008/03/31
Re: strtod bugs, Bruno Haible, 2008/03/30