Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/purescript/purescript-numbers
Functions for working with PureScripts 'Number' type
https://github.com/purescript/purescript-numbers
equality-check floating-point numerics parsing purescript
Last synced: about 21 hours ago
JSON representation
Functions for working with PureScripts 'Number' type
- Host: GitHub
- URL: https://github.com/purescript/purescript-numbers
- Owner: purescript
- License: bsd-3-clause
- Created: 2016-08-23T20:36:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-08T20:14:36.000Z (about 1 year ago)
- Last Synced: 2024-10-29T21:05:42.038Z (16 days ago)
- Topics: equality-check, floating-point, numerics, parsing, purescript
- Language: PureScript
- Homepage: https://pursuit.purescript.org/packages/purescript-numbers/
- Size: 41 KB
- Stars: 13
- Watchers: 6
- Forks: 18
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-numbers
[![Latest release](http://img.shields.io/github/release/purescript/purescript-numbers.svg)](https://github.com/purescript/purescript-numbers/releases)
[![Build status](https://github.com/purescript/purescript-numbers/workflows/CI/badge.svg?branch=master)](https://github.com/purescript/purescript-numbers/actions?query=workflow%3ACI+branch%3Amaster)
[![Pursuit](https://pursuit.purescript.org/packages/purescript-numbers/badge)](https://pursuit.purescript.org/packages/purescript-numbers)Utility functions for working with PureScripts builtin `Number` type.
## Installation
```
spago install numbers
```## Scope
* Parsing with `fromString`
* Formating with `toStringWith`, see `Data.Number.Format`
* Approximate comparisions with `≅`, see `Data.Number.Approximate`
* Not-a-number and infinite value detection with `isNaN` and `isFinite`
* Remainder with `%`
* Trignometric functions with `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, and
`atan2`
* Natural logarithm and exponents with `log` and `exp`
* Powers with `sqrt` and `pow`
* Rounding with `ceil`, `floor`, `round`, and `trunc`
* Numeric minimum and maximum with `min` and `max`, which behave differently to
the versions in `Data.Ord` on values of `NaN`
* Sign and absolute value functions `sign` and `abs`
* Numeric constants `e`, `ln 2`, `ln10`, `log10e`, `log2e`, `pi`, `sqrt1_2`,
`sqrt2`, and `tau`## Documentation
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-numbers).