Does it work now ?

This commit is contained in:
cdricms
2025-09-13 23:20:06 +02:00
parent f10858a604
commit c28024b17d

View File

@@ -384,20 +384,20 @@ public struct UnitValue<ValueType: ConvertibleToDouble>:
} }
/// The result will have the `unit` of the left hand side value. /// The result will have the `unit` of the left hand side value.
public static func * <L: ConvertibleToDouble>( public static func * <L: ConvertibleToDouble, R: BinaryFloatingPoint>(
lhs: UnitValue<L>, rhs: Double lhs: UnitValue<L>, rhs: R
) )
-> UnitValue<Double> -> UnitValue<Double>
{ {
.init(value: lhs.value * rhs, unit: lhs.unit) .init(value: lhs.value * Double(rhs), unit: lhs.unit)
} }
public static func * <R: ConvertibleToDouble>( public static func * <L: BinaryFloatingPoint, R: ConvertibleToDouble>(
lhs: Double, rhs: UnitValue<R> lhs: L, rhs: UnitValue<R>
) )
-> UnitValue<Double> -> UnitValue<Double>
{ {
.init(value: lhs * rhs.value, unit: rhs.unit) .init(value: Double(lhs) * rhs.value, unit: rhs.unit)
} }
/// The result will have the `unit` of the left hand side value. /// The result will have the `unit` of the left hand side value.