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
I have settled on hoisting the GCD and XGCD preconditions (#9) via the Trusted Input ™️ pattern to enable recovery. As an example, the XGCD algorithms should extend all unsigned integers and they only fail when the arguments are infinite. I cannot limit these algorithms to a finite integer types because that makes them unavailable to InfiniInt<T>. So, instead, I'll just require that the inputs are of the Finite<T> type:
extensionBinaryInteger{@inlinablepublicstaticfunc euclidean(
_ lhs:consumingFinite<Self>,
_ rhs:consumingFinite<Self>)-> Magnitude
@inlinable public static func euclidean1(
_ lhs:consumingFinite<Self>,
_ rhs:consumingFinite<Self>)->XGCD1where Self:UnsignedInteger
@inlinable public static func euclidean2(
_ lhs:consumingFinite<Self>,
_ rhs:consumingFinite<Self>)->XGCD2 where Self:UnsignedInteger}
Some convenience methods can then be written as finite integer extensions:
I have settled on hoisting the GCD and XGCD preconditions (#9) via the Trusted Input ™️ pattern to enable recovery. As an example, the XGCD algorithms should extend all unsigned integers and they only fail when the arguments are infinite. I cannot limit these algorithms to a finite integer types because that makes them unavailable to InfiniInt<T>. So, instead, I'll just require that the inputs are of the Finite<T> type:
Some convenience methods can then be written as finite integer extensions:
The current use case does not need Natural<T> but I imagine that it is of similar importance.
The text was updated successfully, but these errors were encountered: