diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2015-12-04 18:22:30 -0500 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2015-12-07 00:42:53 +0000 |
commit | a718a3b25ad53a7246a6196ec4d300079a87f9ea (patch) | |
tree | 380a65e0420b5c1a79edfb6bf2fbd946d3e2fee1 | |
parent | 13353b81126c1ad697c0450811a5d5c47eed896e (diff) | |
download | perl-a718a3b25ad53a7246a6196ec4d300079a87f9ea.tar.gz |
hexfp: Use Perl_fp_class_nzero unconditionally.
Otherwise in platforms with Perl_fp_class_nzero there would be no
return for the x != 0.0 case.
(cherry picked from commit 406d5545e79665094180534380eba323110f99bc)
-rw-r--r-- | numeric.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -1630,11 +1630,9 @@ Users should just always call Perl_signbit(). int Perl_signbit(NV x) { # ifdef Perl_fp_class_nzero - if (x == 0) - return Perl_fp_class_nzero(x); - /* Try finding the high byte, and assume it's highest - * bit is the sign. This assumption is probably wrong - * somewhere. */ + return Perl_fp_class_nzero(x); + /* Try finding the high byte, and assume it's highest bit + * is the sign. This assumption is probably wrong somewhere. */ # elif defined(USE_LONG_DOUBLE) && LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN return (((unsigned char *)&x)[9] & 0x80); # elif defined(NV_LITTLE_ENDIAN) @@ -1645,7 +1643,7 @@ Perl_signbit(NV x) { # elif defined(NV_BIG_ENDIAN) return (((unsigned char *)&x)[0] & 0x80); # else - /* This last fallback will fail for the negative zero. */ + /* This last resort fallback is wrong for the negative zero. */ return (x < 0.0) ? 1 : 0; # endif } |