Merge pull request #225 from fastfloat/fix_win32_ci

fix for 32-bit Visual Studio when not set to round to nearest
This commit is contained in:
Daniel Lemire 2023-11-27 16:21:01 -05:00 committed by GitHub
commit 35d523195b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,10 +202,10 @@ from_chars_result_t<UC> from_chars_advanced(UC const * first, UC const * last,
// We do not have that fegetround() == FE_TONEAREST.
// 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 defined(__clang__)
#if defined(__clang__) || defined(FASTFLOAT_32BIT)
// Clang may map 0 to -0.0 when fegetround() == FE_DOWNWARD
if(pns.mantissa == 0) {
value = pns.negative ? -0. : 0.;
value = pns.negative ? T(-0.) : T(0.);
return answer;
}
#endif