From da6c7657950379364b52024cdb48e38a45590fdb Mon Sep 17 00:00:00 2001 From: Stephen Canon Date: Fri, 8 Aug 2025 13:45:33 -0400 Subject: [PATCH] Constrain AlgebraicField to required Magnitude:AlgebraicField This is formally a source-breaking change. However it is expected to not be source-breaking in practice, because any conforming type either has a real magnitude (in the case of real or complex types), which would necessarily have to support all the AF operations to implement the type, or is perhaps a finite field with a bogus stand-in Magnitude. --- Sources/RealModule/AlgebraicField.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/RealModule/AlgebraicField.swift b/Sources/RealModule/AlgebraicField.swift index 4c8070d..230187b 100644 --- a/Sources/RealModule/AlgebraicField.swift +++ b/Sources/RealModule/AlgebraicField.swift @@ -40,7 +40,7 @@ /// See also `Real`, `SignedNumeric`, `Numeric` and `AdditiveArithmetic`. /// /// [field]: https://en.wikipedia.org/wiki/Field_(mathematics) -public protocol AlgebraicField: SignedNumeric { +public protocol AlgebraicField: SignedNumeric where Magnitude: AlgebraicField { /// Replaces a with the (approximate) quotient `a/b`. static func /=(a: inout Self, b: Self)