diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-03-26 20:27:18 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-03-26 20:27:18 +0100 |
commit | 3e446e9723428ed29c402d1b6ee297e5797b9750 (patch) | |
tree | 45cdb66b8e65721e79efeb492f9921302b97ac6c /newlib/libc/stdlib/strtorx.c | |
parent | 18b47e05d3a971656ebb2306c205d0a6b36e6b91 (diff) | |
download | cygnal-3e446e9723428ed29c402d1b6ee297e5797b9750.tar.gz cygnal-3e446e9723428ed29c402d1b6ee297e5797b9750.tar.bz2 cygnal-3e446e9723428ed29c402d1b6ee297e5797b9750.zip |
strtold: Fix Infinity value.
Infinity returned from strtold is recognized as NaN by GCC builtin
functions. The reason is that ULtox is missing to set a bit.
* libc/stdlib/strtorx.c (ULtox): Set high bit in second word
to create valid Infinity value.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc/stdlib/strtorx.c')
-rw-r--r-- | newlib/libc/stdlib/strtorx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/strtorx.c b/newlib/libc/stdlib/strtorx.c index 44f3db269..961ecd2f2 100644 --- a/newlib/libc/stdlib/strtorx.c +++ b/newlib/libc/stdlib/strtorx.c @@ -88,7 +88,8 @@ ULtox(__UShort *L, __ULong *bits, Long exp, int k) case STRTOG_Infinite: L[_0] = 0x7fff; - L[_1] = L[_2] = L[_3] = L[_4] = 0; + L[_1] = 0x8000; + L[_2] = L[_3] = L[_4] = 0; break; case STRTOG_NaN: |