Skip to content

Jest matcher extension for comparing integer representations of floats (ULP)

License

Notifications You must be signed in to change notification settings

abrie/jest-ieee754

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jest extension for matching numbers by ULP distance

This extension wraps @eirba/ieee754 for use in 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.

About

Jest matcher extension for comparing integer representations of floats (ULP)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published