Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ianmackenzie/elm-float-extra
Useful functionality for Float values in Elm
https://github.com/ianmackenzie/elm-float-extra
Last synced: 24 days ago
JSON representation
Useful functionality for Float values in Elm
- Host: GitHub
- URL: https://github.com/ianmackenzie/elm-float-extra
- Owner: ianmackenzie
- License: mpl-2.0
- Created: 2018-02-12T19:05:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T14:25:57.000Z (over 4 years ago)
- Last Synced: 2024-12-16T20:52:52.068Z (26 days ago)
- Language: Elm
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-ccamel - ianmackenzie/elm-float-extra - Useful functionality for Float values in Elm (Elm)
README
# elm-float-extra
This package contains some basic utilities for working with `Float` values in
[Elm](http://elm-lang.org). I recommmend using it as:```elm
import Float.Extra as Float
```Functionality is provided for comparisons...
```elm
Float.equalWithin 1e-3 1.9999 2.0001
--> TrueList.filter (Float.lessThan 1) [ 0, 0.5, 1, 1.5, 2 ]
--> [ 0, 0.5 ]
```...interpolation...
```elm
Float.interpolateFrom 5 10 0.6
--> 8Float.range { start = 20, end = 30, steps = 4 }
--> [ 20, 22.5, 25, 27.5, 30 ]
```...and some constants:
```elm
Float.positiveInfinity
--> Infinity
```## Contributing
Yes please! I'm very open to bug fixes and requests for new functionality.
Please [open a new
issue](https://github.com/ianmackenzie/elm-float-extra/issues) or send me
(**@ianmackenzie**) a message on the [Elm Slack](https://elmlang.herokuapp.com/)
before starting any major work, though, so we can discuss different approaches.