Update README.md

This commit is contained in:
Daniel Lemire 2024-08-26 10:18:35 -04:00 committed by GitHub
parent 56153ba9d8
commit bc042d6318
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,9 +162,9 @@ It is also the approach taken by the [Microsoft C++ library](https://github.com/
Hence, we have the following examples: Hence, we have the following examples:
```cpp ```cpp
double result = -1; double result = -1;
std::string str = "3e-1000"; std::string str = "3e-1000";
auto r = fast_float::from_chars(str.data(), str.data() + str.size(), result); auto r = fast_float::from_chars(str.data(), str.data() + str.size(), result);
// r.ec == std::errc::result_out_of_range // r.ec == std::errc::result_out_of_range
// r.ptr == str.data() + 7 // r.ptr == str.data() + 7
// result == 0 // result == 0
@ -172,9 +172,9 @@ Hence, we have the following examples:
```cpp ```cpp
double result = -1; double result = -1;
std::string str = "3e1000"; std::string str = "3e1000";
auto r = fast_float::from_chars(str.data(), str.data() + str.size(), result); auto r = fast_float::from_chars(str.data(), str.data() + str.size(), result);
// r.ec == std::errc::result_out_of_range // r.ec == std::errc::result_out_of_range
// r.ptr == str.data() + 6 // r.ptr == str.data() + 6
// result == std::numeric_limits<double>::infinity() // result == std::numeric_limits<double>::infinity()