diff options
author | Jonathan Matthew <jmatthew@cvs.openbsd.org> | 2018-05-28 03:20:26 +0000 |
---|---|---|
committer | Jonathan Matthew <jmatthew@cvs.openbsd.org> | 2018-05-28 03:20:26 +0000 |
commit | 14f744c46fe559c631d29fe8a66d24d5b6e2a037 (patch) | |
tree | d63905ca721356e2d6fe7d893d1502be623c6b3a /lib/libc/arch/arm | |
parent | 49281c127eb29bc31b40aa94b930011cfcf0b21d (diff) |
Clear the sign bit in the QNAN constants used by strtof, strtod and strtold,
so passing "nan" and "-nan" produces a NaN with the right sign.
Bug reported and diff provided by George Koehler.
ok kettenis@
Diffstat (limited to 'lib/libc/arch/arm')
-rw-r--r-- | lib/libc/arch/arm/gdtoa/gd_qnan.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/arch/arm/gdtoa/gd_qnan.h b/lib/libc/arch/arm/gdtoa/gd_qnan.h index 9c59e795bf6..68a76685974 100644 --- a/lib/libc/arch/arm/gdtoa/gd_qnan.h +++ b/lib/libc/arch/arm/gdtoa/gd_qnan.h @@ -1,12 +1,12 @@ -#define f_QNAN 0xffffffff +#define f_QNAN 0x7fffffff #define d_QNAN0 0xffffffff -#define d_QNAN1 0xffffffff +#define d_QNAN1 0x7fffffff #define ld_QNAN0 0xffffffff -#define ld_QNAN1 0xffffffff +#define ld_QNAN1 0x7fffffff #define ld_QNAN2 0x0 #define ld_QNAN3 0x0 #define ldus_QNAN0 0xffff #define ldus_QNAN1 0xffff #define ldus_QNAN2 0xffff -#define ldus_QNAN3 0xffff +#define ldus_QNAN3 0x7fff #define ldus_QNAN4 0x0 |