mirror of
https://github.com/apple/swift-numerics
synced 2026-11-26 04:57:53 +00:00
Test improvements
Improved how tolerance is applied close to infinity for complex division (this still could use a more principled approach, but at least we're in the right ballpark now). Tightened up the tolerance for semi-exhaustive testing too, since that can be done now.
This commit is contained in:
2 files changed
+21
-10
No files matched your search
@@ -42,6 +42,8 @@ extension Complex: AlgebraicField {
|
||||
return z * w.conjugate.divided(by: lenSq)
|
||||
}
|
||||
|
||||
@_alwaysEmitIntoClient // specialization
|
||||
@inline(never)
|
||||
public static func rescaledDivide(_ z: Complex, _ w: Complex) -> Complex {
|
||||
if w.isZero { return .infinity }
|
||||
if !w.isFinite { return .zero }
|
||||
|
||||
Reference in new issue
Block a user