Skip to content

Commit

Permalink
update readme.md (#9)
Browse files Browse the repository at this point in the history
- update readme.md
- add **isNan()** (experimental).
- minor edits.
  • Loading branch information
RobTillaart committed Nov 2, 2023
1 parent b07289a commit 9dc24d2
Show file tree
Hide file tree
Showing 8 changed files with 315 additions and 198 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.1.8] - 2023-11-02
- update readme.md
- add **isNan()** (experimental).
- minor edits.


## [0.1.7] - 2022-11-07
- add changelog.md
- add rp2040 to build-CI
- update readme.md
- update keywords.txt


## [0.1.6] - 2021-12-18
- update library.json
- update license
Expand Down
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@


[![Arduino CI](https://github.com/RobTillaart/float16/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/float16/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/float16/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/float16/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/float16/actions/workflows/jsoncheck.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/float16/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/float16.svg?maxAge=3600)](https://github.com/RobTillaart/Complex/releases)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/float16.svg)](https://github.com/RobTillaart/float16/issues)

[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/float16/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/float16.svg?maxAge=3600)](https://github.com/RobTillaart/float16/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/float16.svg)](https://registry.platformio.org/libraries/robtillaart/float16)

# float16

Expand All @@ -30,7 +31,7 @@ a floating point number. As it uses only 2 bytes where float and double have typ

| attribute | value | notes |
|:----------|:-------------|:--------|
| size | 2 bytes | layout s eeeee mmmmmmmmmm
| size | 2 bytes | layout s eeeee mmmmmmmmmm (1,5,10)
| sign | 1 bit |
| exponent | 5 bit |
| mantissa | 11 bit | ~ 3 digits
Expand Down Expand Up @@ -66,9 +67,16 @@ a floating point number. As it uses only 2 bytes where float and double have typ
```


#### Related

- https://wokwi.com/projects/376313228108456961 (demo of its usage)


## Interface

to elaborate
```cpp
#include "float16.h"
```

#### Constructors

Expand Down Expand Up @@ -126,20 +134,25 @@ negation operator.
- **bool isInf()** returns true if value is (-)infinite.


#### Experimental 0.1.8

- **bool isNaN()** returns true if value is not a number.


## Notes


## Future


#### 0.1.x
#### Must

- update documentation.
- unit tests of the above.
- isNan().

#### Should

- unit tests of the above.

#### later
#### Could

- update documentation.
- error handling.
Expand All @@ -149,3 +162,14 @@ negation operator.
- add storage example - with SD card, FRAM or EEPROM
- add communication example - serial or Ethernet?

#### Wont


## Support

If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.

Thank you,

88 changes: 88 additions & 0 deletions examples/float16_test_performance/performance_0.1.7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

//
// test: UNO
// IDE: 1.8.13
//

FLOAT16_LIB_VERSION: 0.1.7

CONSTRUCTORS
Constructor: 28
a = b: 4

CONVERSION
toDouble(): 428

COMPARE
compare == : 4
compare != : 4
compare < : 4
compare <= : 4
compare >= : 4
compare > : 8

MATH I
math + : 864
math - : 812
math * : 812
math / : 812

MATH II
math += : 872
math -= : 820
math *= : 804
math /= : 804

17.8125
MATH III - negation
negation : 4

-17.8125

done

------------------------------------------

//
// test: RP2040
// IDE: 1.8.13
//

FLOAT16_LIB_VERSION: 0.1.7

CONSTRUCTORS
Constructor: 19
a = b: 2

CONVERSION
toDouble(): 96

COMPARE
compare == : 4
compare != : 3
compare < : 7
compare <= : 6
compare >= : 6
compare > : 6

MATH I
math + : 67
math - : 60
math * : 58
math / : 54

MATH II
math += : 62
math -= : 61
math *= : 61
math /= : 45

767.0000
MATH III - negation
negation : 7

-767.0000

done

-------------------------------------------
Loading

0 comments on commit 9dc24d2

Please sign in to comment.