Repository navigation
Fix rem of a Rational into a Normed type - #349
Conversation
`(1//3) % N0f8` threw a `MethodError`, because `_unsafe_trunc` fell back to `unsafe_trunc`, which had no `Rational` method.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #349 +/- ##
=======================================
Coverage 96.83% 96.84%
=======================================
Files 7 7
Lines 791 793 +2
=======================================
+ Hits 766 768 +2
Misses 25 25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kimikage
left a comment
There was a problem hiding this comment.
Good catch.
In actual cases, the denominator should always be 1, but I don't think that is a major issue.
Although it is not the focus of this PR, I think it would be good to have tests for Fixed as well, for the sake of the future.
Oh, indeed.
|
`Q0f7(1/3)` states the intent better than `Q0f7(43 / 128)` and is still an independent reference, because the constructor rounds in `_convert`, not in `_rem`.
|
Thank you for your contribution. |
(1//3) % N0f8threw aMethodError, because_unsafe_truncfell back tounsafe_trunc, which had noRationalmethod.