This package contains some basic utilities for working with Float
values in
Elm. I recommmend using it as:
import Float.Extra as Float
Functionality is provided for comparisons...
Float.equalWithin 1e-3 1.9999 2.0001
--> True
List.filter (Float.lessThan 1) [ 0, 0.5, 1, 1.5, 2 ]
--> [ 0, 0.5 ]
...interpolation...
Float.interpolateFrom 5 10 0.6
--> 8
Float.range { start = 20, end = 30, steps = 4 }
--> [ 20, 22.5, 25, 27.5, 30 ]
...and some constants:
Float.positiveInfinity
--> Infinity
Yes please! I'm very open to bug fixes and requests for new functionality. Please open a new issue or send me (@ianmackenzie) a message on the Elm Slack before starting any major work, though, so we can discuss different approaches.