Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire authored Aug 26, 2024
1 parent bc042d6 commit cba388b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ Hence, we have the following examples:
// result == std::numeric_limits<double>::infinity()
```

Users who wish for the value to be left unmodified given `std::errc::result_out_of_range` may do so by adding two lines of code:

```cpp
double old_result = result; // make copy
auto r = fast_float::from_chars(start, end, result);
if(r.ec == std::errc::result_out_of_range) { result = old_result; }
```
## C++20: compile-time evaluation (constexpr)
In C++20, you may use `fast_float::from_chars` to parse strings
Expand Down

0 comments on commit cba388b

Please sign in to comment.