From ea2d1d81a7dfaa7a53402742475640ed6d98ceee Mon Sep 17 00:00:00 2001 From: cdricms <36056008+cdricms@users.noreply.github.com> Date: Fri, 8 Aug 2025 10:24:09 +0200 Subject: [PATCH] ConvertibleToDouble instead of Numeric --- Sources/Units/Units.swift | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Sources/Units/Units.swift b/Sources/Units/Units.swift index 2f23759..d75c39b 100644 --- a/Sources/Units/Units.swift +++ b/Sources/Units/Units.swift @@ -340,28 +340,36 @@ public struct UnitValue: } /// The result will have the `unit` of the left hand side value. - public static func - (lhs: UnitValue, rhs: UnitValue) + public static func - ( + lhs: UnitValue, rhs: UnitValue + ) -> UnitValue { (lhs.value - rhs.value)[lhs.unit] } /// The result will have the `unit` of the left hand side value. - public static func + (lhs: UnitValue, rhs: UnitValue) + public static func + ( + lhs: UnitValue, rhs: UnitValue + ) -> UnitValue { (lhs.value + rhs.value)[lhs.unit] } /// The result will have the `unit` of the left hand side value. - public static func * (lhs: UnitValue, rhs: UnitValue) + public static func * ( + lhs: UnitValue, rhs: UnitValue + ) -> UnitValue { (lhs.value * rhs.value)[lhs.unit] } /// The result will have the `unit` of the left hand side value. - public static func / (lhs: UnitValue, rhs: UnitValue) + public static func / ( + lhs: UnitValue, rhs: UnitValue + ) -> UnitValue { guard rhs.value != 0 else {