Don't use pow and log10 directly because it causes an overflow.
This commit is contained in:
parent
c20ed80ef4
commit
c3dee50e5b
2 changed files with 10 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue