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
They are "unchecked", so it is a self-contradiction that they join the CheckedArithmetic. 😅 However, I think it's reasonable to assume that they just provide the opt-out functionality.
This allows you to call them as CheckedArithmeticCore.wrapping_* (essentially a re-export to CheckedArithmetic.wrapping_*) regardless of where they are implemented. That is, we can support @wrapping and @saturating in the same way as @checked. As you may have noticed, `replace_checked!' was already generalized. 😝 https://github.com/JuliaMath/CheckedArithmetic.jl/pull/8/files#diff-716c7804fe3fca686524a1eae34996ea
While there's nothing hard about defining the APIs itself, there are a few challenges that need to be overcome to make @saturating and@wrapping practical. One is that, as mentioned in #7, the fallback implementations are required. And related to that, there is no systematic implementation of Integer "saturating" operations in Base.
The text was updated successfully, but these errors were encountered:
My implementation of the FixedPoint saturating operations means that we have already implemented most of the Integer saturating operations. In other words, they are worth reusing.
Therefore, I think the implementation of saturating operations for Integers may exist in the CheckedArithmeticCore. Furthermore, I believe that LLVM's saturating instructions are worthy of being supported by Julia.
As mentioned in https://discourse.julialang.org/t/rfc-what-should-the-arithmetic-within-the-fixedpointnumbers-be/46697, I would like to add the definitions of arithmetic operations such as
saturating_add
andwrapping_sub
, currently defined inFixedPointNumbers#master
, to theCheckedArithmeticCore
.They are "unchecked", so it is a self-contradiction that they join the
CheckedArithmetic
. 😅 However, I think it's reasonable to assume that they just provide the opt-out functionality.This allows you to call them as
CheckedArithmeticCore.wrapping_*
(essentially a re-export toCheckedArithmetic.wrapping_*
) regardless of where they are implemented. That is, we can support@wrapping
and@saturating
in the same way as@checked
. As you may have noticed, `replace_checked!' was already generalized. 😝https://github.com/JuliaMath/CheckedArithmetic.jl/pull/8/files#diff-716c7804fe3fca686524a1eae34996ea
While there's nothing hard about defining the APIs itself, there are a few challenges that need to be overcome to make
@saturating
and@wrapping
practical. One is that, as mentioned in #7, the fallback implementations are required. And related to that, there is no systematic implementation ofInteger
"saturating" operations inBase
.The text was updated successfully, but these errors were encountered: