Skip to content

Commit ac95497

Browse files
authored
update GitHub actions (#14)
- update GitHub actions - update examples - minor edits
1 parent 78bf064 commit ac95497

20 files changed

Lines changed: 73 additions & 32 deletions

File tree

.github/workflows/arduino-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
runs-on: ubuntu-latest
77
timeout-minutes: 5
88
steps:
9-
- uses: actions/checkout@v4
10-
- uses: arduino/arduino-lint-action@v1
9+
- uses: actions/checkout@v5
10+
- uses: arduino/arduino-lint-action@v2
1111
with:
1212
library-manager: update
1313
compliance: strict

.github/workflows/arduino_test_runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
timeout-minutes: 20
99

1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v5
1212
- uses: ruby/setup-ruby@v1
1313
with:
1414
ruby-version: 2.6

.github/workflows/jsoncheck.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
paths:
66
- '**.json'
77
pull_request:
8+
paths:
9+
- '**.json'
810

911
jobs:
1012
test:
1113
runs-on: ubuntu-latest
1214
timeout-minutes: 5
1315
steps:
14-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1517
- name: json-syntax-check
1618
uses: limitusus/json-syntax-check@v2
1719
with:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.3.1] - 2025-10-13
10+
- update GitHub actions
11+
- update examples
12+
- minor edits
13+
914
## [0.3.0] - 2024-04-17
1015
- Fix #12, breaking change. Thanks to Andyjbm for the measurements.
1116
- remove Printable interface as it makes the effective footprint larger!

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2015-2024 Rob Tillaart
3+
Copyright (c) 2015-2025 Rob Tillaart
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1921
function to and from float32 type.
2022

2123
The 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
3133
as 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
4446
Implemented in https://github.com/RobTillaart/float16ext class.
4547

4648

47-
#### Difference with float16 and float16ext
49+
### Difference with float16 and float16ext
4850

4951
The float16ext library has an extended range as it supports values from +- 65504
5052
to +- 131008.
@@ -59,7 +61,7 @@ Although they share a lot of code float16 and float16ext should not be mixed.
5961
In 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

6466
Version 0.3.0 has a breaking change. The **Printable** interface is removed as
6567
it 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
7981
of float16 elements using only 2 bytes per element.
8082

8183

82-
#### Breaking change 0.2.0
84+
### Breaking change 0.2.0
8385

8486
Version 0.2.0 has a breaking change as a conversion bug has been found.
8587
See 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

116118
Source: 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
170172
with care.
171173

172174

173-
#### Export and store
175+
### Export and store
174176

175177
To 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

183185
The library implement the standard compare functions.
184186
These 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

199201
Math is done by converting to double, do the math and convert back.
200202
These operators are added for convenience only.

examples/float16_sizeof_array/float16_sizeof_array.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ float test32[100];
1414

1515
void setup()
1616
{
17+
while (!Serial);
1718
Serial.begin(115200);
19+
Serial.println();
20+
Serial.println(__FILE__);
21+
Serial.print("FLOAT16_LIB_VERSION: ");
22+
Serial.println(FLOAT16_LIB_VERSION);
23+
Serial.println();
24+
1825

1926
Serial.println("FLOAT16");
2027
Serial.println(sizeof(test16) / sizeof(test16[0]));
@@ -42,3 +49,7 @@ void setup()
4249
void loop()
4350
{
4451
};
52+
53+
54+
// -- END OF FILE --
55+

examples/float16_test0/float16_test0.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@
3232

3333
void setup()
3434
{
35-
while(!Serial);
35+
while (!Serial);
3636
Serial.begin(115200);
37+
Serial.println();
3738
Serial.println(__FILE__);
3839
Serial.print("FLOAT16_LIB_VERSION: ");
3940
Serial.println(FLOAT16_LIB_VERSION);
40-
Serial.println("\nStart ");
41+
Serial.println();
42+
43+
Serial.println("Start ");
4144

4245
Serial.println();
4346

examples/float16_test1/float16_test1.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ float16 X;
1212

1313
void setup()
1414
{
15-
while(!Serial);
15+
while (!Serial);
1616
Serial.begin(115200);
17+
Serial.println();
1718
Serial.println(__FILE__);
1819
Serial.print("FLOAT16_LIB_VERSION: ");
1920
Serial.println(FLOAT16_LIB_VERSION);
21+
Serial.println();
2022

2123
float f;
2224

2325
// dump all possible values
24-
for (uint16_t n = 0; n < 65535; n++)
26+
for (uint16_t n = 0; n < 65535; n++)
2527
{
2628
f = X.f16tof32(n);
2729
Serial.print(n);

examples/float16_test_all/float16_test_all.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ void setup()
2424
{
2525
while (!Serial);
2626
Serial.begin(115200);
27+
Serial.println();
2728
Serial.println(__FILE__);
2829
Serial.print("FLOAT16_LIB_VERSION: ");
2930
Serial.println(FLOAT16_LIB_VERSION);
30-
Serial.println("\nStart ");
31+
Serial.println();
32+
33+
Serial.println("Start ");
3134

3235
test_1();
3336
test_2();

0 commit comments

Comments
 (0)