-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support precision math of add & sub
- Loading branch information
1 parent
0e4cf12
commit 210dd0d
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { precisionAdd, precisionSub } from '../../src/math'; | ||
|
||
describe('precision', () => { | ||
it('precision add', () => { | ||
expect(precisionAdd(0.1, 0.2)).toBe(0.3); | ||
}); | ||
it('precision sub', () => { | ||
expect(precisionSub(33, 23.33)).toBe(9.67); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters