You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+13-2
Original file line number
Diff line number
Diff line change
@@ -28,11 +28,12 @@ struct from_chars_result {
28
28
```
29
29
30
30
It parses the character sequence [first,last) for a number. It parses floating-point numbers expecting
31
-
a locale-independent format equivalent to what is used by `std::strtod` in the default ("C") locale.
31
+
a locale-independent format equivalent to the C++17 from_chars function.
32
32
The resulting floating-point value is the closest floating-point values (using either float or double),
33
33
using the "round to even" convention for values that would otherwise fall right in-between two values.
34
34
That is, we provide exact parsing according to the IEEE standard.
35
35
36
+
36
37
Given a successful parse, the pointer (`ptr`) in the returned value is set to point right after the
37
38
parsed number, and the `value` referenced is set to the parsed value. In case of error, the returned
38
39
`ec` contains a representative error, otherwise the default (`std::errc()`) value is stored.
@@ -64,10 +65,20 @@ the type `fast_float::chars_format`. It is a bitset value: we check whether
64
65
to determine whether we allow the fixed point and scientific notation respectively.
65
66
The default is `fast_float::chars_format::general` which allows both `fixed` and `scientific`.
66
67
67
-
The library seeks to follow the C++17 (see 20.19.3.(7.1)) specification. In particular, it forbids leading spaces and the leading '+' sign.
68
+
The library seeks to follow the C++17 (see [20.19.3](http://eel.is/c++draft/charconv.from.chars).(7.1)) specification.
69
+
* The `from_chars` function does not skip leading white-space characters.
70
+
*[A leading `+` sign](https://en.cppreference.com/w/cpp/utility/from_chars) is forbidden.
71
+
* It is generally impossible to represent a decimal value exactly as binary floating-point number (`float` and `double` types). We seek the nearest value. We round to an even mantissa when we are in-between two binary floating-point numbers.
72
+
73
+
Furthermore, we have the following restrictions:
74
+
* We only support `float` and `double` types at this time.
75
+
* We only support the decimal format: we do not support hexadecimal strings.
76
+
* For values that are either very large or very small (e.g., `1e9999`), we represent it using the infinity or negative infinity value.
68
77
69
78
We support Visual Studio, macOS, Linux, freeBSD. We support big and little endian. We support 32-bit and 64-bit systems.
0 commit comments