mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.1.16 Fraction
This commit is contained in:
parent
8788c109fa
commit
299170332e
@ -1,4 +1,4 @@
|
||||
# Change Log fraction
|
||||
# Change Log Fraction
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.1.16] - 2023-11-02
|
||||
- update readme.md
|
||||
- minor edits
|
||||
|
||||
|
||||
## [0.1.15] - 2023-02-02
|
||||
- update GitHub actions
|
||||
- update license 2023
|
||||
@ -14,7 +19,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- change signature **double toDouble()**
|
||||
- add **Fraction_performance.ino** to start performance testing.
|
||||
|
||||
|
||||
## [0.1.14] - 2022-11-07
|
||||
- add changelog.md
|
||||
- add rp2040 to build-CI
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: fraction.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.15
|
||||
// VERSION: 0.1.16
|
||||
// PURPOSE: Arduino library to implement a Fraction data type
|
||||
// URL: https://github.com/RobTillaart/Fraction
|
||||
|
||||
@ -404,6 +404,7 @@ void Fraction::fractionize(float val)
|
||||
float testHigh = high.n - high.d * val;
|
||||
if (testHigh < Precision * high.d)
|
||||
break; // high is answer
|
||||
|
||||
if (testLow < Precision * low.d)
|
||||
{ // low is answer
|
||||
high = low;
|
||||
|
@ -2,15 +2,14 @@
|
||||
//
|
||||
// FILE: fraction.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.15
|
||||
// VERSION: 0.1.16
|
||||
// PURPOSE: Arduino library to implement a Fraction data type
|
||||
// URL: https://github.com/RobTillaart/Fraction
|
||||
//
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#define FRACTION_LIB_VERSION (F("0.1.15"))
|
||||
#define FRACTION_LIB_VERSION (F("0.1.16"))
|
||||
|
||||
|
||||
class Fraction: public Printable
|
||||
|
@ -15,8 +15,8 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/Fraction.git"
|
||||
},
|
||||
"version": "0.1.15",
|
||||
"frameworks": "arduino",
|
||||
"version": "0.1.16",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
"headers": "fraction.h"
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
name=Fraction
|
||||
version=0.1.15
|
||||
version=0.1.16
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library to implement a Fraction datatype
|
||||
sentence=Arduino library to implement a Fraction datatype.
|
||||
paragraph=Nominator and denominator are limited to 4 digits. Experimental.
|
||||
category=Data Processing
|
||||
url=https://github.com/RobTillaart/Fraction
|
||||
|
@ -2,8 +2,11 @@
|
||||
[![Arduino CI](https://github.com/RobTillaart/Fraction/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
||||
[![Arduino-lint](https://github.com/RobTillaart/Fraction/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Fraction/actions/workflows/arduino-lint.yml)
|
||||
[![JSON check](https://github.com/RobTillaart/Fraction/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Fraction/actions/workflows/jsoncheck.yml)
|
||||
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/Fraction.svg)](https://github.com/RobTillaart/Fraction/issues)
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Fraction/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/RobTillaart/Fraction.svg?maxAge=3600)](https://github.com/RobTillaart/Fraction/releases)
|
||||
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/Fraction.svg)](https://registry.platformio.org/libraries/robtillaart/Fraction)
|
||||
|
||||
|
||||
# Fraction
|
||||
@ -51,7 +54,7 @@ In short, use fractions with care otherwise your sketch might get broken ;)
|
||||
|
||||
#### Printable
|
||||
|
||||
The Fraction library implements Printable, so one can do.
|
||||
The Fraction library implements the Printable interface, so one can do.
|
||||
|
||||
```cpp
|
||||
Fraction fr(PI);
|
||||
@ -102,7 +105,6 @@ The library is reasonably tested. If problems arise please open an issue.
|
||||
#### Should
|
||||
|
||||
- performance testing
|
||||
|
||||
- investigate divide by zero errors
|
||||
- NAN in fraction? => 0/0 ?
|
||||
- INF in fraction? => 1/0 and -1/0?
|
||||
@ -120,3 +122,12 @@ The library is reasonably tested. If problems arise please open an issue.
|
||||
|
||||
#### 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,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user