mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 01:06:48 +08:00
Update README.md
This commit is contained in:
parent
56153ba9d8
commit
bc042d6318
12
README.md
12
README.md
@ -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()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user