https://github.com/abrie/jest-ieee754
Jest matcher extension for comparing integer representations of floats (ULP)
https://github.com/abrie/jest-ieee754
float64 javascript jest-extension ulp ulp-distance
Last synced: 3 months ago
JSON representation
Jest matcher extension for comparing integer representations of floats (ULP)
- Host: GitHub
- URL: https://github.com/abrie/jest-ieee754
- Owner: abrie
- License: mit
- Created: 2020-05-02T13:47:05.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T17:44:52.000Z (over 2 years ago)
- Last Synced: 2024-10-24T00:58:28.640Z (8 months ago)
- Topics: float64, javascript, jest-extension, ulp, ulp-distance
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@eirba/jest-ieee754
- Size: 1.87 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jest extension for matching numbers by ULP distance
This extension wraps [`@eirba/ieee754`](https://github.com/abrie/ieee754) for use in [Jest](https://github.com/facebook/jest) unit tests. The following matchers are provided:
- `toBeCloseToNumber(a:number, maxUlp?:bigint):boolean`
- `toBeCloseToArraySnapshot():boolean`## Install
- `yarn add @eirba/jest-ieee754`
or
- `npm install @eirba/jest-ieee754`
## Examples
For usage examples, please see the [unit tests](https://github.com/abrie/jest-ieee754/tree/master/test).