Conversation
| Fixed{T, f}(x) where {T,f} = convert(Fixed{T,f}, x) | ||
| Fixed{T, f}(x::Fixed{T,f}) where {T,f} = x | ||
| Fixed{T, f}(x::Char) where {T,f} = throw(ArgumentError("Fixed cannot be constructed from a Char")) | ||
| Fixed{T, f}(x::Complex) where {T,f} = Fixed{T, f}(real(x)) |
There was a problem hiding this comment.
real returns the real part even if there is a non-zero complex part. Would it be better to use convert and get the InexactError?
There was a problem hiding this comment.
Yes, that is a blunder. The reason I ended here is that Complex{S}, for some reason, didn't match the ambiguous signature. Guess it will have to be Fixed{T, f}(convert(real(eltype(x)), x)). Will push a fix.
c6ebe4e to
91b2f53
Compare
Add some tests
Codecov Report
@@ Coverage Diff @@
## master #105 +/- ##
=========================================
+ Coverage 91.44% 91.7% +0.26%
=========================================
Files 4 4
Lines 187 193 +6
=========================================
+ Hits 171 177 +6
Misses 16 16
Continue to review full report at Codecov.
|
|
I think it should be ready now. I've also added some tests. |
|
Great, thanks again! |
Fixes #101