{"id":13893836,"url":"https://github.com/RobTillaart/FLE","last_synced_at":"2025-07-17T08:31:04.107Z","repository":{"id":46314250,"uuid":"281416877","full_name":"RobTillaart/FLE","owner":"RobTillaart","description":"Arduino Library for floating point datatype with error math","archived":false,"fork":false,"pushed_at":"2024-04-13T09:00:00.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T06:03:34.722Z","etag":null,"topics":["arduino","error","float","math"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobTillaart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"RobTillaart","custom":"https://www.paypal.me/robtillaart"}},"created_at":"2020-07-21T14:15:12.000Z","updated_at":"2023-10-13T20:37:41.000Z","dependencies_parsed_at":"2024-04-19T04:15:49.948Z","dependency_job_id":null,"html_url":"https://github.com/RobTillaart/FLE","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/RobTillaart/FLE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FFLE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FFLE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FFLE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FFLE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobTillaart","download_url":"https://codeload.github.com/RobTillaart/FLE/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FFLE/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265585281,"owners_count":23792712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","error","float","math"],"created_at":"2024-08-06T18:01:18.190Z","updated_at":"2025-07-17T08:31:03.834Z","avatar_url":"https://github.com/RobTillaart.png","language":"C++","funding_links":["https://github.com/sponsors/RobTillaart","https://www.paypal.me/robtillaart"],"categories":["C++"],"sub_categories":[],"readme":"\n[![Arduino CI](https://github.com/RobTillaart/FLE/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)\n[![Arduino-lint](https://github.com/RobTillaart/FLE/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/FLE/actions/workflows/arduino-lint.yml)\n[![JSON check](https://github.com/RobTillaart/FLE/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/FLE/actions/workflows/jsoncheck.yml)\n[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/FLE.svg)](https://github.com/RobTillaart/FLE/issues)\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/FLE/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/RobTillaart/FLE.svg?maxAge=3600)](https://github.com/RobTillaart/FLE/releases)\n[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/FLE.svg)](https://registry.platformio.org/libraries/robtillaart/FLE)\n\n\n# FLE\n\nArduino library for Arduino library for float with error data type\n\n\n## Description\n\nThis **experimental** library provides basic math when have a quantity with a certain \nerror margin. E.g. when you approximate PI as 22/7 it is not exact. By doing the \nmath with FLE's one can see how much error adds up in an calculation.\n\nNote: This library is experimental and only usable for educational purposes.\nThere is no active development.\n\n\n## Interface\n\n```cpp\n#include \"FLE.h\"\n```\n\n\n### Printable\n\nThe FLE class implements the public interface of Printable.\nThis allows you to print an FLE in human readable form.\n\n```cpp\n    FLE x(3.14, 0.002);\n    x.setDecimals(4);\n    Serial.println(x);                 // will print 3.1400 ± 0.0020\n    Serial.println(x.setDecimals(2));  // will print 3.14 ± 0.00\n    Serial.println(x.value());         // will print 3.14\n```\n\nWhen the ± char does not print correctly, one could change the font.\n\n\n### Functions\n\n- **FLE(val = 0, err = 0)** constructor, with default value and error set to 0.\n- **PrintTo(Print\u0026 p)** printable interface, define a stream to print to.  \nFormat is \"value ± error\" see above (plus-minus ± = char(0177))\n- **setDecimals(n)** will print the FLE both value and error with n decimals.\n- **setSeparator(char c)** overrules the standard ± char. (0177)\n- **value()** returns value part.\n- **error()** return error part.\n- **relError()** returns relative error, except when value == 0. \nThen the function returns 0. Q: should this be \"NaN\" ?\n- **high()** returns value + error margin (= max real value).\n- **low()** returns value - error margin (= min real value).\n\nFurthermore the basic math is implemented, \"+, -, \\*, /, +=, -=, \\*=, /=\"\n\n\n#### Set like functions\n\n- **bool in(FLE y)** x.in(y) returns true if x lies completely in y  (range is a subset)\n- **FLE shared(FLE y)** returns the overlapping range. \n\n\n#### Weak propositions\n\nExperimental.\n\n- **bool peq(FLE \u0026y)** possible equal.\n- **bool pne(FLE \u0026y)** possible not equal.\n- **bool plt(FLE \u0026y)** possible less than.\n- **bool ple(FLE \u0026y)** possible less equal.\n- **bool pgt(FLE \u0026y)** possible greater than.\n- **bool pge(FLE \u0026y)** possible greater equal.\n\n\n## Operation\n\n- negative numbers not tested yet\n\nSee example\n\n\n## Future\n\n#### Must\n\n- update documentation\n\n#### Should\n\n#### Could\n\n- comparison (investigate, what means equal or less than ..)\n- functions log, exp,\n- functions sqr, sqrt, pow\n- functions sin, cos, tan (+ inverse + hyp)\n- test ad infinitum \n- option to set the ± char for platforms that cannot print it.\n- test negative numbers\n- test large / small numbers.\n- test other separator\n- more demo sketches...\n\n#### Wont\n\n\n## Support\n\nIf you appreciate my libraries, you can support the development and maintenance.\nImprove the quality of the libraries by providing issues and Pull Requests, or\ndonate through PayPal or GitHub sponsors.\n\nThank you,\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobTillaart%2FFLE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRobTillaart%2FFLE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobTillaart%2FFLE/lists"}