Skip to content

Commit 35d5231

Browse files
authored
Merge pull request #225 from fastfloat/fix_win32_ci
fix for 32-bit Visual Studio when not set to round to nearest
2 parents 736561c + fda9716 commit 35d5231

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/fast_float/parse_number.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ from_chars_result_t<UC> from_chars_advanced(UC const * first, UC const * last,
202202
// We do not have that fegetround() == FE_TONEAREST.
203203
// Next is a modified Clinger's fast path, inspired by Jakub Jelínek's proposal
204204
if (pns.exponent >= 0 && pns.mantissa <=binary_format<T>::max_mantissa_fast_path(pns.exponent)) {
205-
#if defined(__clang__)
205+
#if defined(__clang__) || defined(FASTFLOAT_32BIT)
206206
// Clang may map 0 to -0.0 when fegetround() == FE_DOWNWARD
207207
if(pns.mantissa == 0) {
208-
value = pns.negative ? -0. : 0.;
208+
value = pns.negative ? T(-0.) : T(0.);
209209
return answer;
210210
}
211211
#endif

0 commit comments

Comments
 (0)