You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
isapprox does not handle typemin(::FixedPoint{<:Signed}) correctly #209
I don't think this is a critical issue, but I plan to add checked_abs / saturating_abs after PR #190. Also, in the future, the default arithmetic may be changed to the checked arithmetic.
This seems to be omitted by the compiler, but atol=max(eps(x), eps(y)) is verbose.
Also, since the difference between the n-bit values is in n bits, I think widen1 is excessive.
The current constructor is basically based on RoundNearest, but in this case it should be based on RoundDown or RoundToZero.
I plan to partially support the constructors with RoundingMode option, but such constructors are unsuitable in this case because they check the input range.
Just FYI, JuliaImages couldn't tolerate a big performance hit.
When was that? We still have things to do.
Arithmetic performance in JuliaImages should strongly depend on ColorTypes, Colors, ColorVectorSpace as well as FixedPointNumbers. For example, ColorBlendModes has a "non-slow" multiplication for N0f8/N0f16 components in advance (cf. #174).
I meant, "couldn't" in the sense of "would not be able to," not something that happened in the past. Meaning, if arithmetic suddenly got 5x slower that wouldn't be something we'd be happy about.
I suppose it would be worth checking to see how often it actually comes up. In many applications we probably multiply by a float first, at which point it leaves the domain of FPN.
Activity
kimikage commentedon Aug 8, 2020
This seems to be omitted by the compiler, but
atol=max(eps(x), eps(y))is verbose.Also, since the difference between the
n-bit values is innbits, I thinkwiden1is excessive.The current constructor is basically based on
RoundNearest, but in this case it should be based onRoundDownorRoundToZero.FixedPointNumbers.jl/src/FixedPointNumbers.jl
Line 94 in 3e41a6a
I plan to partially support the constructors with
RoundingModeoption, but such constructors are unsuitable in this case because they check the input range.kimikage commentedon Aug 9, 2020
BTW, the tolerance in
Baseimplementation ismax(atol, rtol*max(norm(x), norm(y))). Is the difference (i.e.max/+) intentional?cf.
PR #59 (Oct. 8, 2016)
JuliaLang/julia#22742 (Jul. 11, 2017)
timholy commentedon Aug 10, 2020
What's your plan for eliminating the performance hit?
Probably not. As you deduced, it likely didn't follow changes in Julia itself.
kimikage commentedon Aug 10, 2020
It is to give up.:sweat_smile: In any case, we haven't reached the stage of deciding that yet. PR #190 is just a small step.
For this issue, since
rtolis usually inFloat64if it is not0, I will changeabs(x)toabs(float(x)).timholy commentedon Aug 10, 2020
Just FYI, JuliaImages couldn't tolerate a big performance hit. We'd have to fork the package and go our own way.
kimikage commentedon Aug 10, 2020
When was that? We still have things to do.
Arithmetic performance in JuliaImages should strongly depend on
ColorTypes,Colors,ColorVectorSpaceas well asFixedPointNumbers. For example,ColorBlendModeshas a "non-slow" multiplication forN0f8/N0f16components in advance (cf. #174).timholy commentedon Aug 10, 2020
I meant, "couldn't" in the sense of "would not be able to," not something that happened in the past. Meaning, if arithmetic suddenly got 5x slower that wouldn't be something we'd be happy about.
I suppose it would be worth checking to see how often it actually comes up. In many applications we probably multiply by a float first, at which point it leaves the domain of FPN.