s/positive/non-negative/ for minimumScale.

This commit is contained in:
Stephen Canon committed 2020-07-14 12:33:25 -04:00
1 parent f275f7df53
commit cfeda4df2d
1 file changed
+2 -2
+2 -2
View File
@@ -83,7 +83,7 @@ extension Numeric where Magnitude: FloatingPoint {
/// return (a - b).magnitude < t * scale
/// ```
/// The tolerance `t` must be in `.ulpOfOne ..< 1`. The `minimumScale` must
/// be positive and finite.
/// be non-negative and finite.
///
/// - Parameters:
/// - other: The value to compare.
@@ -103,7 +103,7 @@ extension Numeric where Magnitude: FloatingPoint {
return delta < atol
case let .relative(rtol, floor):
assert(rtol >= .ulpOfOne && rtol < 1, "Relative tolerance must be in [.ulpOfOne, 1).")
assert(floor >= 0 && floor.isFinite, "Minimum scale must be positive and finite.")
assert(floor >= 0 && floor.isFinite, "Minimum scale must be non-negative and finite.")
let scale = max(self.magnitude, other.magnitude, floor)
return delta < scale*rtol
}