-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Fix #12, breaking change. Thanks to Andyjbm for the measurements. - remove Printable interface as it makes the effective footprint larger! - remove getDecimals() and setDecimals(). - patch examples and unit test for the above. - add example **float16_sizeof_array.ino**. - add **isPosInf()** and **isNegInf()** - add link to **float16ext** class with a larger range than float16. - update readme.md. - update unit-tests.
- Loading branch information
1 parent
f8319b1
commit 78bf064
Showing
17 changed files
with
328 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// FILE: float16_sizeof_array.ino | ||
// AUTHOR: Rob Tillaart | ||
// PURPOSE: test float16 size | ||
// URL: https://github.com/RobTillaart/float16 | ||
// See #12 | ||
|
||
#include "Arduino.h" | ||
#include "float16.h" | ||
|
||
|
||
float16 test16[100]; | ||
float test32[100]; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
|
||
Serial.println("FLOAT16"); | ||
Serial.println(sizeof(test16) / sizeof(test16[0])); | ||
Serial.println(sizeof(test16)); | ||
Serial.println(sizeof(test16[0])); | ||
Serial.println(); | ||
|
||
Serial.println("FLOAT32"); | ||
Serial.println(sizeof(test32) / sizeof(test32[0])); | ||
Serial.println(sizeof(test32)); | ||
Serial.println(sizeof(test32[0])); | ||
Serial.println(); | ||
|
||
// set some values to make sure the compiler doesn't optimise out the arrays. | ||
test16[5] = 32; | ||
test32[4] = 32; | ||
|
||
// Serial.println(test16[5].toDouble(), 3); | ||
// Serial.println(test16[5].toFloat(), 3); | ||
// Serial.println(test16[5].toString()); | ||
// Serial.println(test16[5].toString(1)); | ||
// Serial.println(test16[5].toString(3)); | ||
}; | ||
|
||
void loop() | ||
{ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
float16_test_array.ino | ||
FLOAT16_LIB_VERSION: 0.3.0 | ||
|
||
0 5.07 | ||
1 -0.51 | ||
2 -2.27 | ||
3 3.58 | ||
4 6.30 | ||
5 -0.28 | ||
6 2.44 | ||
7 5.78 | ||
8 6.23 | ||
9 4.09 | ||
0.30 | ||
|
||
0 5.07 | ||
1 -0.51 | ||
2 -2.27 | ||
3 3.58 | ||
4 6.30 | ||
5 -0.28 | ||
6 2.44 | ||
7 5.78 | ||
8 6.23 | ||
9 4.09 | ||
0.30 | ||
|
||
SIZE: 20 | ||
SIZE: 20 | ||
|
||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.