Skip to content

Commit

Permalink
static_cast to silent warning implict conversion (HowardHinnant#693)
Browse files Browse the repository at this point in the history
That happen because `sizeof(long long unsigned int) == sizeof(long double)` in 32-bit architectures.
  • Loading branch information
nico-engels authored Aug 17, 2021
1 parent d57d764 commit b0adc54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/date/date.h
Original file line number Diff line number Diff line change
Expand Up @@ -6405,7 +6405,7 @@ read_long_double(std::basic_istream<CharT, Traits>& is, unsigned m = 1, unsigned
is.setstate(std::ios::failbit);
return 0;
}
return i + f/std::pow(10.L, fcount);
return static_cast<long double>(i) + static_cast<long double>(f)/std::pow(10.L, fcount);
}

struct rs
Expand Down

0 comments on commit b0adc54

Please sign in to comment.