-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Allow absolute precision in assert_almost_equal (#13357)
This commit adds a new keyword argument `check_low_values`, that will allow the approximate comparison of numerics based on literal decimal places. This is particularly useful when comparing low values: # This fails because it's doing (1 - .1 / .1001) assert_almost_equal(0.1, 0.1001, check_less_precise=True) # This will work as intuitively expected assert_almost_equal( 0.1, 0.1001, check_less_precise=True, check_low_values=True )
- Loading branch information
Joao Veiga
committed
Dec 30, 2019
1 parent
db062da
commit 0910110
Showing
3 changed files
with
80 additions
and
9 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
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
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