Skip to content

Commit cba388b

Browse files
authored
Update README.md
1 parent bc042d6 commit cba388b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ Hence, we have the following examples:
180180
// result == std::numeric_limits<double>::infinity()
181181
```
182182

183+
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:
184+
185+
```cpp
186+
double old_result = result; // make copy
187+
auto r = fast_float::from_chars(start, end, result);
188+
if(r.ec == std::errc::result_out_of_range) { result = old_result; }
189+
```
190+
191+
183192
## C++20: compile-time evaluation (constexpr)
184193
185194
In C++20, you may use `fast_float::from_chars` to parse strings

0 commit comments

Comments
 (0)