From bc042d6318277a6d9e48a9ebb0113e6b4a2fe417 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Mon, 26 Aug 2024 10:18:35 -0400 Subject: [PATCH] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8740a62..0d0f0d3 100644 --- a/README.md +++ b/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: ```cpp - double result = -1; - std::string str = "3e-1000"; - auto r = fast_float::from_chars(str.data(), str.data() + str.size(), result); + double result = -1; + std::string str = "3e-1000"; + auto r = fast_float::from_chars(str.data(), str.data() + str.size(), result); // r.ec == std::errc::result_out_of_range // r.ptr == str.data() + 7 // result == 0 @@ -172,9 +172,9 @@ Hence, we have the following examples: ```cpp - double result = -1; - std::string str = "3e1000"; - auto r = fast_float::from_chars(str.data(), str.data() + str.size(), result); + double result = -1; + std::string str = "3e1000"; + auto r = fast_float::from_chars(str.data(), str.data() + str.size(), result); // r.ec == std::errc::result_out_of_range // r.ptr == str.data() + 6 // result == std::numeric_limits::infinity()