Don't use pow and log10 directly because it causes an overflow.

This commit is contained in:
King_DuckZ 2017-04-13 19:21:25 +01:00
parent c20ed80ef4
commit c3dee50e5b
2 changed files with 10 additions and 1 deletions

View file

@ -78,4 +78,9 @@ TEST_CASE ("Check string to int conversions", "[s2i][lexical_cast]") {
}
TEST_CASE ("Check int to string conversions", "[i2s][lexical_cast]") {
using std::string;
using dhandy::lexical_cast;
CHECK(lexical_cast<string>(1) == "1");
CHECK(lexical_cast<string>(static_cast<uint16_t>(0xFFFF)) == "65535");
}