@@ -25,22 +25,43 @@ a floating point number. As it is only 2 bytes where float and double have typic
25254 and 8, gains can be made at the price of range and precision.
2626
2727
28- ## specs
28+ ## Specifications
2929
30- To elaborate table
3130
32- | attribute | value |
33- | :---------:| :----------:|
34- | Size | 2 bytes |
35- | mantissa | |
36- | exponent | |
37- | minimum | |
38- | maximum | |
31+ | attribute | value | notes |
32+ | :----------| :-------------| :-------------|
33+ | Size | 2 bytes | |
34+ | sign | 1 bit | |
35+ | mantissa | 11 bit | ~ 3 digits |
36+ | exponent | 4 bit | |
37+ | minimum | 1.0009765625 | 1 + 2^−10 |
38+ | maximum | 65504 | |
39+ | | | |
3940
4041
4142## Interface
4243
43- See float16.h for a list of functions implemented.
44+ to elaborate
45+
46+ #### Constructors
47+
48+ - ** float16(void)** defaults to zero.
49+ - ** float16(double f)** constructor.
50+ - ** float16(const float16 &f)** copy constructor.
51+
52+
53+ #### Conversion
54+
55+ - ** double toDouble(void)** convert to double (or float)
56+ - ** size_t printTo(Print& p) const** Printable interface.
57+ - ** void setDecimals(uint8_t d)** idem, used for printTo.
58+ - ** uint8_t getDecimals()** idem.
59+
60+ Note the setDecimals takes one byte per object which is not efficient for arrays.
61+ See array example for efficient storage using set/getBinary() functions.
62+
63+
64+ #### Compare
4465
4566to elaborate
4667
@@ -56,16 +77,47 @@ The strategy is to get these working first and optionally optimize them later.
5677
5778## TODO (future)
5879
59- not in priority order.
80+ to get focus on getting things done...
81+
82+
83+ #### 0.1.4
84+
85+ the following should work:
86+
87+ - update documentation
88+ - positive numbers
89+ - negative numbers
90+ - infinity
91+ - rounding to zero (e.g. 1e-30)
92+ - array of numbers.
93+ - unit tests of the above..
94+
95+
96+ #### 0.1.5
97+
98+ - update documentation
99+ - comparison operators
100+ - unit tests of the above..
101+
102+
103+ #### 0.1.6
60104
61105- update documentation
62106- get basic math working (+-* /)
63- - divide by zero errors.
64- - f16tof32() + f32tof16()
65- - rewrite toDouble with bit magic
66107- isNan()
67108- isINF()
68109- abs()
69110- sgn()
111+ - unit tests of the above..
112+
113+
114+ #### later
115+
116+ - update documentation
117+ - get basic math II working += -= * = /=
118+ - divide by zero errors.
119+ - f16tof32() + f32tof16()
120+ - rewrite toDouble with bit magic
121+ - ...
70122
71123
0 commit comments