Skip to content

Commit

Permalink
Float documentation and unit tests (#455)
Browse files Browse the repository at this point in the history
Improve `Float.mo`:
* Documentation
* Unit tests

Issues detected while refactoring:
* dfinity/motoko#3646
* dfinity/motoko#3647

Other possible areas of improvements for `Float`:
* `isNaN()` function is missing
* `equals()` comparison should consider numerical errors, by requiring an epsilon argument.
* Positive infinity and negative infinity constants are missing.
* `compare` function does not have a total order and is inconsistent, e.g. `compare(NaN, NaN) == #greater`. 
* `neq` function has a typo. Rename to `neg`

The suggestions for improvement are summarized in issue #456
  • Loading branch information
luc-blaeser committed Jan 5, 2023
1 parent e52bc25 commit 3729c65
Show file tree
Hide file tree
Showing 2 changed files with 4,501 additions and 61 deletions.
Loading

0 comments on commit 3729c65

Please sign in to comment.