Skip to content

Commit 3eb19ba

Browse files
committed
Minor fixes.
1 parent 32f6629 commit 3eb19ba

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

stdlib/private/DifferentiationUnittest/DifferentiationUnittest.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,17 @@ extension Tracked : SignedNumeric & Numeric where T : SignedNumeric, T == T.Magn
114114
}
115115

116116
public static func *= (lhs: inout Tracked, rhs: Tracked) {
117-
lhs = Tracked(lhs.value * rhs.value)
117+
lhs = lhs * rhs
118+
}
119+
}
120+
121+
extension Tracked where T : FloatingPoint {
122+
public static func / (lhs: Tracked, rhs: Tracked) -> Tracked {
123+
return Tracked(lhs.value / rhs.value)
124+
}
125+
126+
public static func /= (lhs: inout Tracked, rhs: Tracked) {
127+
lhs = lhs / rhs
118128
}
119129
}
120130

0 commit comments

Comments
 (0)