motoko-base
motoko-base copied to clipboard
Possible improvements for `Float.mo` (and `Int.mo`)
Possible areas of improvements for the Float.mo
base library:
-
isNaN()
function is missing -
equal()
andnotEqual()
comparisons 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 toneg
. The same typo is inInt.mo
.
Compiler issues detected while refactoring Float.mo
:
- https://github.com/dfinity/motoko/issues/3646
- https://github.com/dfinity/motoko/issues/3647
Improvement for Int.mo
base library:
- Fix typo in function name
neq
.
Update: Resolved in meantime:
- https://github.com/dfinity/motoko-base/pull/480
- https://github.com/dfinity/motoko-base/pull/479
- https://github.com/dfinity/motoko/pull/3676
Currently still open:
- Positive infinity and negative infinity constants are missing.
- https://github.com/dfinity/motoko/issues/3647