-
Notifications
You must be signed in to change notification settings - Fork 33
Improve overflow error message #214
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
Conversation
This displays the fixed point type of the input in the message, not the rawtype. This also avoids the stall with `checked_{add/sub}` on Windows.
@test all(x -> saturating_neg(x) == clamp(fneg(x), F), xs) | ||
@test all(x -> !(typemin(F) < fneg(x) < typemax(F)) || | ||
@test all(x -> saturating_neg(x) === clamp(fneg(x), F), xs) | ||
@test all(x -> !(typemin(F) <= fneg(x) <= typemax(F)) || |
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.
I had excluded typemin
and typemax
with the intention of writing generic code for 100% testing. They have a risk of causing inconsistencies due to the rounding errors in floating point operations.
However, I decided against supporting non-8-bit types in 100% tests for multiplication. So we can safely include typemin
and typemax
for 8-bit types.
Codecov Report
@@ Coverage Diff @@
## master #214 +/- ##
==========================================
+ Coverage 88.24% 88.48% +0.23%
==========================================
Files 6 6
Lines 485 495 +10
==========================================
+ Hits 428 438 +10
Misses 57 57
Continue to review full report at Codecov.
|
This displays the fixed point type of the input in the message, not the rawtype.
This displays the fixed point type of the input in the message, not the rawtype.
This displays the fixed point type of the input in the message, not the rawtype.
This displays the fixed point type of the input in the message, not the rawtype.
This displays the fixed point type of the input in the message, not the rawtype. (cf. #190 (comment))
Of course, more information could be added to the error message, but I think the error message in the constructor is sufficient to supplement it.
This also avoids the stall with
checked_{add/sub}
on Windows. (cf. #190 (comment)) TBH, this is the real purpose of this PR. 😅