Skip to content

Commit 1cbb5a8

Browse files
authored
add changelog.md (#8)
1 parent aae975c commit 1cbb5a8

8 files changed

Lines changed: 75 additions & 37 deletions

File tree

.arduino-ci.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
platforms:
2+
rpipico:
3+
board: rp2040:rp2040:rpipico
4+
package: rp2040:rp2040
5+
gcc:
6+
features:
7+
defines:
8+
- ARDUINO_ARCH_RP2040
9+
warnings:
10+
flags:
11+
12+
packages:
13+
rp2040:rp2040:
14+
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
15+
116
compile:
217
# Choosing to run compilation tests on 2 different Arduino platforms
318
platforms:
@@ -8,4 +23,8 @@ compile:
823
- m4
924
- esp32
1025
# - esp8266
11-
# - mega2560
26+
# - mega2560
27+
- rpipico
28+
29+
libraries:
30+
- "printHelpers"

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Change Log Float16
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
9+
## [0.1.7] - 2022-11-07
10+
- add changelog.md
11+
- add rp2040 to build-CI
12+
- update readme.md
13+
- update keywords.txt
14+
15+
16+
## [0.1.6] - 2021-12-18
17+
- update library.json
18+
- update license
19+
- minor edits
20+
21+
## [0.1.5] - 2021-12-02
22+
- add basic math
23+
- optimize compare operators
24+
25+
## [0.1.4] - 2021-11-26
26+
- setup repo to get it working again.
27+
- still experimental.
28+
29+
----
30+
31+
## [0.1.03] - eons ago ??
32+
- ??
33+
34+
## [0.1.02] - 2015-03-14
35+
- getting rounding right
36+
37+
## [0.1.01] - 2015-03-12
38+
- make base conversion separate functions
39+
40+
## [0.1.00] - 2015-03-10
41+
- initial version
42+

float16.cpp

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
//
22
// FILE: float16.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.5
4+
// VERSION: 0.1.7
55
// PURPOSE: library for Float16s for Arduino
66
// URL: http://en.wikipedia.org/wiki/Half-precision_floating-point_format
77
//
8-
// HISTORY:
9-
// 0.1.00 2015-03-10 initial version
10-
// 0.1.01 2015-03-12 make base conversion separate functions
11-
// 0.1.02 2015-03-14 getting rounding right
12-
// 0.1.03
13-
// 0.1.4 2021-11-26 setup repo to get it working again.
14-
// still experimental.
15-
// 0.1.5 2021-12-02 add basic math, optimize compare operators
16-
// 0.1.6 2021-12-18 update library.json, license, minor edits
8+
// HISTORY: see changelog.md
179

1810

1911
#include "float16.h"
@@ -27,15 +19,13 @@ float16::float16(double f)
2719
_value = f32tof16(f);
2820
}
2921

30-
3122
// PRINTING
3223
size_t float16::printTo(Print& p) const
3324
{
3425
double d = this->f16tof32(_value);
3526
return p.print(d, _decimals);
3627
};
3728

38-
3929
double float16::toDouble() const
4030
{
4131
return f16tof32(_value);
@@ -51,7 +41,6 @@ bool float16::operator == (const float16 &f)
5141
return (_value == f._value);
5242
}
5343

54-
5544
bool float16::operator != (const float16 &f)
5645
{
5746
return (_value != f._value);
@@ -111,46 +100,39 @@ float16 float16::operator + (const float16 &f)
111100
return float16(this->toDouble() + f.toDouble());
112101
}
113102

114-
115103
float16 float16::operator - (const float16 &f)
116104
{
117105
return float16(this->toDouble() - f.toDouble());
118106
}
119107

120-
121108
float16 float16::operator * (const float16 &f)
122109
{
123110
return float16(this->toDouble() * f.toDouble());
124111
}
125112

126-
127113
float16 float16::operator / (const float16 &f)
128114
{
129115
return float16(this->toDouble() / f.toDouble());
130116
}
131117

132-
133118
float16& float16::operator += (const float16 &f)
134119
{
135120
*this = this->toDouble() + f.toDouble();
136121
return *this;
137122
}
138123

139-
140124
float16& float16::operator -= (const float16 &f)
141125
{
142126
*this = this->toDouble() - f.toDouble();
143127
return *this;
144128
}
145129

146-
147130
float16& float16::operator *= (const float16 &f)
148131
{
149132
*this = this->toDouble() * f.toDouble();
150133
return *this;
151134
}
152135

153-
154136
float16& float16::operator /= (const float16 &f)
155137
{
156138
*this = this->toDouble() / f.toDouble();
@@ -170,7 +152,6 @@ int float16::sign()
170152
return 0;
171153
}
172154

173-
174155
bool float16::isZero()
175156
{
176157
return ((_value & 0x7FFF) == 0x0000);
@@ -231,7 +212,6 @@ float float16::f16tof32(uint16_t _value) const
231212
return sgn ? -f : f;
232213
}
233214

234-
235215
uint16_t float16::f32tof16(float f) const
236216
{
237217
uint32_t t = *(uint32_t *) &f;

float16.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: float16.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.1.6
5+
// VERSION: 0.1.7
66
// PURPOSE: Arduino library to implement float16 data type.
77
// half-precision floating point format,
88
// used for efficient storage and transport.
@@ -12,7 +12,7 @@
1212

1313
#include "Arduino.h"
1414

15-
#define FLOAT16_LIB_VERSION (F("0.1.6"))
15+
#define FLOAT16_LIB_VERSION (F("0.1.7"))
1616

1717

1818
class float16: public Printable

keywords.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ float16 KEYWORD1
66

77

88
# Methods and Functions (KEYWORD2)
9+
toDouble KEYWORD2
10+
getBinary KEYWORD2
11+
setBinary KEYWORD2
12+
13+
setDecimals KEYWORD2
14+
getDecimals KEYWORD2
915

1016

1117
# Constants (LITERAL1)
18+
FLOAT16_LIB_VERSION LITERAL1
1219

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/float16.git"
1717
},
18-
"version": "0.1.6",
18+
"version": "0.1.7",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=float16
2-
version=0.1.6
2+
version=0.1.7
33
author=Rob Tillaart <rob.tillaart@gmail.com>
44
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
55
sentence=Arduino library to implement float16 data type.

test/unit_test_001.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ unittest(test_constructor)
8888

8989
unittest(test_compare_equal)
9090
{
91-
fprintf(stderr, "FLOAT16_LIB_VERSION: %s\n", (char*) FLOAT16_LIB_VERSION);
92-
9391
float16 a(1);
9492
float16 b(1);
9593
float16 c(2);
@@ -110,8 +108,6 @@ unittest(test_compare_equal)
110108

111109
unittest(test_compare_1nequal)
112110
{
113-
fprintf(stderr, "FLOAT16_LIB_VERSION: %s\n", (char*) FLOAT16_LIB_VERSION);
114-
115111
float16 a(1);
116112
float16 b(1);
117113
float16 c(2);
@@ -138,8 +134,6 @@ unittest(test_compare_1nequal)
138134

139135
unittest(test_negation)
140136
{
141-
fprintf(stderr, "FLOAT16_LIB_VERSION: %s\n", (char*) FLOAT16_LIB_VERSION);
142-
143137
float16 f16(123.456);
144138
float16 f17(-f16);
145139
float16 f18 = -f16;
@@ -151,8 +145,6 @@ unittest(test_negation)
151145

152146
unittest(test_conversion)
153147
{
154-
fprintf(stderr, "FLOAT16_LIB_VERSION: %s\n", (char*) FLOAT16_LIB_VERSION);
155-
156148
for (int i = 0; i < 20; i++)
157149
{
158150
float f = random(60000000) * 0.001;
@@ -164,8 +156,6 @@ unittest(test_conversion)
164156

165157
unittest(test_printable)
166158
{
167-
fprintf(stderr, "FLOAT16_LIB_VERSION: %s\n", (char*) FLOAT16_LIB_VERSION);
168-
169159
float16 f16(123.456);
170160
// test default value.
171161
assertEqual(4, f16.getDecimals());

0 commit comments

Comments
 (0)