@@ -15,7 +15,9 @@ Arduino library to implement float16 data type.
1515
1616## Description
1717
18- This ** experimental** library defines the float16 (2 byte) data type, including conversion
18+ ** Experimental**
19+
20+ This library defines the float16 (2 byte) data type, including conversion
1921function to and from float32 type.
2022
2123The primary usage of the float16 data type is to efficiently store and transport
@@ -31,7 +33,7 @@ In pre 0.3.0 version the Printable interface was implemented, but it has been re
3133as it caused excessive memory usage when declaring arrays of float16.
3234
3335
34- #### ARM alternative half-precision
36+ ### ARM alternative half-precision
3537
3638-https://en.wikipedia.org/wiki/Half-precision_floating-point_format#ARM_alternative_half-precision
3739
@@ -44,7 +46,7 @@ instead, an exponent of 31 encodes normalized numbers in the range 65536 to 1310
4446Implemented in https://github.com/RobTillaart/float16ext class.
4547
4648
47- #### Difference with float16 and float16ext
49+ ### Difference with float16 and float16ext
4850
4951The float16ext library has an extended range as it supports values from +- 65504
5052to +- 131008.
@@ -59,7 +61,7 @@ Although they share a lot of code float16 and float16ext should not be mixed.
5961In the future these libraries might merge / derive one from the other.
6062
6163
62- #### Breaking change 0.3.0
64+ ### Breaking change 0.3.0
6365
6466Version 0.3.0 has a breaking change. The ** Printable** interface is removed as
6567it causes larger than expected arrays of float 16 (See #16 ). On ESP8266 every
@@ -79,7 +81,7 @@ The footprint of the library is now smaller and one can now create compact array
7981of float16 elements using only 2 bytes per element.
8082
8183
82- #### Breaking change 0.2.0
84+ ### Breaking change 0.2.0
8385
8486Version 0.2.0 has a breaking change as a conversion bug has been found.
8587See for details in issue #10 .
@@ -111,7 +113,7 @@ There is still an issue with 0 versus -0 (sign gets lost in conversion).
111113± = ALT 0177
112114
113115
114- #### Example values
116+ ### Example values
115117
116118Source: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
117119
@@ -139,7 +141,7 @@ Source: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
139141```
140142
141143
142- #### Related
144+ ### Related
143145
144146- https://wokwi.com/projects/376313228108456961 (demo of its usage)
145147- https://github.com/RobTillaart/float16
@@ -154,14 +156,14 @@ Source: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
154156#include " float16.h"
155157```
156158
157- #### Constructors
159+ ### Constructors
158160
159161- ** float16(void)** defaults value to zero.
160162- ** float16(double f)** constructor.
161163- ** float16(const float16 &f)** copy constructor.
162164
163165
164- #### Conversion
166+ ### Conversion
165167
166168- ** double toDouble(void)** convert value to double or float (if the same e.g. UNO).
167169- ** float toFloat(void)** convert value to float.
@@ -170,15 +172,15 @@ Please note that the accuracy is only 3-4 digits for the whole number so use dec
170172with care.
171173
172174
173- #### Export and store
175+ ### Export and store
174176
175177To serialize the internal format e.g. to disk, two helper functions are available.
176178
177179- ** uint16_t getBinary()** get the 2 byte binary representation.
178180- ** void setBinary(uint16_t u)** set the 2 bytes binary representation.
179181
180182
181- #### Compare
183+ ### Compare
182184
183185The library implement the standard compare functions.
184186These are optimized, so it is fast to compare 2 float16 values.
@@ -194,7 +196,7 @@ You can improve performance by converting e.g. a threshold only once before comp
194196- ** bool operator <= (const float16& f)**
195197
196198
197- #### Math (basic)
199+ ### Math (basic)
198200
199201Math is done by converting to double, do the math and convert back.
200202These operators are added for convenience only.
0 commit comments