Skip to content

Commit 7a5ee5a

Browse files
authored
Merge pull request #296 from dalle/dalle/float16
16-bit float support
2 parents 1d50f57 + 87aae63 commit 7a5ee5a

File tree

4 files changed

+985
-117
lines changed

4 files changed

+985
-117
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ The library seeks to follow the C++17 (see
107107
[28.2.3.(6.1)](https://eel.is/c++draft/charconv.from.chars#6.1)) specification.
108108
109109
* The `from_chars` function does not skip leading white-space characters (unless
110-
`fast_float::chars_format::chars_format` is set).
110+
`fast_float::chars_format::skip_white_space` is set).
111111
* [A leading `+` sign](https://en.cppreference.com/w/cpp/utility/from_chars) is
112-
forbidden (unless `fast_float::chars_format::skip_white_space` is set).
112+
forbidden (unless `fast_float::chars_format::allow_leading_plus` is set).
113113
* It is generally impossible to represent a decimal value exactly as binary
114114
floating-point number (`float` and `double` types). We seek the nearest value.
115115
We round to an even mantissa when we are in-between two binary floating-point
@@ -118,8 +118,8 @@ The library seeks to follow the C++17 (see
118118
Furthermore, we have the following restrictions:
119119
120120
* We support `float` and `double`, but not `long double`. We also support
121-
fixed-width floating-point types such as `std::float32_t` and
122-
`std::float64_t`.
121+
fixed-width floating-point types such as `std::float64_t`, `std::float32_t`,
122+
`std::float16_t`, and `std::bfloat16_t`.
123123
* We only support the decimal format: we do not support hexadecimal strings.
124124
* For values that are either very large or very small (e.g., `1e9999`), we
125125
represent it using the infinity or negative infinity value and the returned
@@ -241,7 +241,8 @@ constexpr double constexptest() {
241241
## C++23: Fixed width floating-point types
242242

243243
The library also supports fixed-width floating-point types such as
244-
`std::float32_t` and `std::float64_t`. E.g., you can write:
244+
`std::float64_t`, `std::float32_t`, `std::float16_t`, and `std::bfloat16_t`.
245+
E.g., you can write:
245246

246247
```C++
247248
std::float32_t result;

0 commit comments

Comments
 (0)