Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #356 +/- ##
==========================================
- Coverage 97.22% 97.21% -0.01%
==========================================
Files 7 7
Lines 792 790 -2
==========================================
- Hits 770 768 -2
Misses 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0a74ffe to
6c98776
Compare
6c98776 to
b036653
Compare
|
Test results on julia v1.0 - v1.13 and nightly |
signed() and unsigned()signed() and unsigned()
PatrickHaecker
left a comment
There was a problem hiding this comment.
I don't get the point of this PR. It breaks for older Julia versions exactly what #350 wants to avoid by being honest about what is supported and what isn't.
| signed(x::X) where {X <: FixedPoint} = signed(X)(signed(x.i), 0) | ||
| unsigned(x::X) where {X <: FixedPoint} = unsigned(X)(unsigned(x.i), 0) |
There was a problem hiding this comment.
On Julia 1.3, this breaks the code (no surprise here):
julia> using FixedPointNumbers; signed(1N0f8)
1There was a problem hiding this comment.
Making code that was working stop working is a breaking change, but I’m skeptical about whether making code that wasn’t working start working in an undesirable way counts as a breaking change.
As far as these two methods are concerned, I don't have a strong opinion.
However, if we interpret “breaking changes” too strictly, we won't be able to fix bugs.
There was a problem hiding this comment.
Good point.
I still like the "more honest" approach of #350 better (and I would suggest that we avoid spending time on compatibility with versions no one uses with upgraded package versions anyway – sorry for triggering this), but I can follow your argument here: It wasn't working before and in that sense it's not too bad that it is not working now. Nevertheless, the question remains why it's better to return an incorrect result instead of throwing.
|
I'd like to create a separate PR to fix the test, and then fix the bug of |
This was separated from PR #350.
There was a discussion regarding
signed(T)andunsigned(T)in late 2018, and as of at least 2020, no clear conclusion had been reached regarding generalization to types other thanInteger(including the addition ofsignedtype()andunsignedtype()). (cf. JuliaLang/julia#30445)More than five years have passed since then, but since there has been no movement toward generalization in other packages, I believe that even if this package supports
SNormedorUFixed,FixedPointwould not supportsigned()orunsigned().In other words, the stub has fulfilled its role as a placeholder. Furthermore, it will not affect existing codes, as long as they don't abuse the bug in Julia <v1.4.
I don't remember why I did it, but some of the
signtests should have been marked@test_brokeninstead of@test_throws.