0.1.4 Interval

This commit is contained in:
Rob Tillaart 2023-11-07 15:01:17 +01:00
parent dffdc1b153
commit b8b7012b5e
6 changed files with 52 additions and 27 deletions

View File

@ -6,11 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.4] - 2023-11-07
- update readme.md
- minor edits
## [0.1.3] - 2022-11-14
- Add RP2040 support to build-CI.
- Add CHANGELOG.md
## [0.1.2] - 2021-12-20
- update library.json
- update license
@ -19,13 +23,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.1] - 2021-05-27
- add Arduino-lint
----
## [0.1.0] - 2020-12-30
- Arduino-CI
- unit tests
- setRange()
----
## [0.0.1] - 2020-07-20
- initial version (not complete)

View File

@ -2,11 +2,9 @@
// FILE: Interval.cpp
// AUTHOR: Rob Tillaart
// DATE: 2020-07-21
// VERSION: 0.1.3
// VERSION: 0.1.4
// PURPOSE: Arduino library for Interval data type
// URL: https://github.com/RobTillaart/Interval
//
// HISTORY: see changelog.md
#include "Interval.h"
@ -18,7 +16,7 @@ Interval::Interval(float lo, float hi)
{
_lo = lo;
_hi = hi;
}
}
else
{
_lo = hi;
@ -150,22 +148,22 @@ bool Interval::operator != (const Interval &in)
// {
// return this->value() > in.value();
// }
//
//
// bool Interval::operator >= (const Interval &in)
// {
// return this->value() >= in.value();
// }
//
//
// bool Interval::operator < (const Interval &in)
// {
// return this->value() < in.value();
// }
//
//
// bool Interval::operator <= (const Interval &in)
// {
// return this->value() <= in.value();
// }
// -- END OF FILE --
// -- END OF FILE --

View File

@ -3,17 +3,14 @@
// FILE: Interval.h
// AUTHOR: Rob Tillaart
// DATE: 2020-07-21
// VERSION: 0.1.3
// VERSION: 0.1.4
// PURPOSE: Arduino library for Interval datatype
// URL: https://github.com/RobTillaart/Interval
//
// HISTORY:
// see Interval.cpp file
#include "Arduino.h"
#define INTERVAL_LIB_VERSION (F("0.1.3"))
#define INTERVAL_LIB_VERSION (F("0.1.4"))
class Interval: public Printable
@ -22,14 +19,14 @@ public:
// CONSTRUCTOR
Interval();
Interval(float lo, float hi);
Interval(float f); // default zero interval [f, f]
Interval(float f); // default zero interval [f, f]
// PRINTABLE
size_t printTo(Print& p) const;
void setDecimals(uint8_t n) { _decimals = n; };
// BASE FUNCTIONS
float value() { return (_hi /2 + _lo /2); }; // assumption
float value() { return (_hi /2 + _lo /2); }; // assumption / estimation
float range() { return _hi -_lo; };
float high() { return _hi; };
float low() { return _lo; };
@ -56,8 +53,8 @@ public:
// SET OPERATORS
// Interval operator & (const Interval&); // common part [1, 5] & [4, 8] => [4, 5]
// Interval operator | (const Interval&); // superset [1, 5] | [4, 8] => [1, 8]
// Interval operator & (const Interval&); // common part [1, 5] & [4, 8] => [4, 5]
// Interval operator | (const Interval&); // superset [1, 5] | [4, 8] => [1, 8]
// Interval operator ^ (const Interval&); //
// smaller
@ -68,5 +65,5 @@ private:
};
// -- END OF FILE --
// -- END OF FILE --

View File

@ -2,8 +2,11 @@
[![Arduino CI](https://github.com/RobTillaart/Interval/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/Interval/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Interval/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/Interval/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Interval/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/Interval.svg)](https://github.com/RobTillaart/Interval/issues)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Interval/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/Interval.svg?maxAge=3600)](https://github.com/RobTillaart/Interval/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/Interval.svg)](https://registry.platformio.org/libraries/robtillaart/Interval)
# Interval
@ -13,7 +16,7 @@ Arduino library for the Interval data type. **Experimental**
## Description
This experimental library provides basic math when you do not know a quantity.
This **experimental** library provides basic math when you do not know a quantity.
The only thing you do know is the value is in a certain interval.
After doing some math you want to know the interval of possible outcomes.
@ -27,6 +30,10 @@ Frink itself is not investigated, so semantics are not necessary similar.
## Interface
```cpp
#include "Interval.h"
```
The Interval class implements the public interface of Printable.
This allows you to print an Interval in human readable form.
@ -134,7 +141,26 @@ See example
## Future
#### Must
- improve documentation
- clean up
#### Should
- play and extend the library.
- check all to be investigated above.
- clean up the documentation.
#### Could
#### 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,

View File

@ -1,7 +1,7 @@
{
"name": "Interval",
"keywords": "Interval, range, value",
"description": "Arduino library for Interval datatype",
"description": "Arduino library for Interval data type",
"authors":
[
{
@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/Interval"
},
"version": "0.1.3",
"version": "0.1.4",
"license": "MIT",
"frameworks": "*",
"platforms": "*",

View File

@ -1,8 +1,8 @@
name=Interval
version=0.1.3
version=0.1.4
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for Interval datatype
sentence=Arduino library for Interval data type.
paragraph=
category=Data Processing
url=https://github.com/RobTillaart/Interval.git