-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Decimal
in floats checker
#503
Conversation
c82270d
to
8e4dbfd
Compare
Codecov Report
@@ Coverage Diff @@
## master #503 +/- ##
==========================================
+ Coverage 72.8% 72.91% +0.11%
==========================================
Files 126 126
Lines 3938 3947 +9
==========================================
+ Hits 2867 2878 +11
+ Misses 1071 1069 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for this.
cedc046
to
a7cb316
Compare
dmoj/checkers/floats.py
Outdated
@@ -27,7 +28,12 @@ def verify_default(process_float, judge_float, epsilon): | |||
abs(1.0 - process_float / judge_float) <= epsilon) | |||
|
|||
|
|||
def check(process_output, judge_output, precision=6, error_mode='default', **kwargs): | |||
def check(process_output, judge_output, precision=6, high_precision=False, error_mode='default', **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about precision and other stuff you can control in the decimal context?
a7cb316
to
ad1834a
Compare
ad1834a
to
7b4cda5
Compare
Reverts #503. This is completely broken. The checker will reject anything because `Decimal` constructor does not accept `bytes`. Once that bug is fixed, the inability to control `Decimal`'s precision makes the test case fail, since the numbers do compare equal at default precision. In other words, the only test case worked by accident.
Closes #456.