Automattic / Automattic/expect.js

Approximate floating point value

Open
#83 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.1k
Forks
207
PR merge metrics
No merged PRs in 30d

Description

Expect.js currently does not support ensuring a floating point number approximates another number within a certain accuracy. Proposed usage:

``` js
expect(0.99999).to.approximate(0.99998, 4); // works
expect(0.99999).to.approximate(0.99998, 5); // fails
expect(0.999999).to.approximate(0.999998, 5); // works
expect(0.999999).to.approximate(0.999998, 6); // fails
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.