Skip to content

Commit

Permalink
In some cases, Visual Studio, when compiling 32-bit binaries, gets
Browse files Browse the repository at this point in the history
0*something == -0 even when the 'something' is positive, when the system
is not set to compile to nearest.
  • Loading branch information
lemire committed Nov 27, 2023
1 parent 80400d2 commit 70d8e0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fast_float/parse_number.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ 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.;
Expand Down

0 comments on commit 70d8e0a

Please sign in to comment.