Merge pull request #156 from fastfloat/dlemire/fix_issue_154

Fixing issue 154.
This commit is contained in:
Daniel Lemire 2022-11-25 16:35:07 -05:00 committed by GitHub
commit be962361c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,8 +156,8 @@ from_chars_result from_chars_advanced(const char *first, const char *last,
// We do not have that fegetround() == FE_TONEAREST. // We do not have that fegetround() == FE_TONEAREST.
// Next is a modified Clinger's fast path, inspired by Jakub Jelínek's proposal // Next is a modified Clinger's fast path, inspired by Jakub Jelínek's proposal
if (pns.exponent >= 0 && pns.mantissa <=binary_format<T>::max_mantissa_fast_path(pns.exponent)) { if (pns.exponent >= 0 && pns.mantissa <=binary_format<T>::max_mantissa_fast_path(pns.exponent)) {
#if (defined(_WIN32) && defined(__clang__)) #if defined(__clang__)
// ClangCL may map 0 to -0.0 when fegetround() == FE_DOWNWARD // Clang may map 0 to -0.0 when fegetround() == FE_DOWNWARD
if(pns.mantissa == 0) { if(pns.mantissa == 0) {
value = 0; value = 0;
return answer; return answer;