Skip to content

Commit 96f2fd5

Browse files
committed
Added inverse multiplication operator
1 parent 585cedd commit 96f2fd5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Synercoding.Primitives/UnitValue.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,15 @@ public bool Equals(UnitValue other)
216216
public static UnitValue operator *(UnitValue a, double b)
217217
=> new UnitValue(a.Value * b, a.Unit);
218218

219+
/// <summary>
220+
/// Multiply a given <see cref="UnitValue"/> by a <see cref="double"/>
221+
/// </summary>
222+
/// <param name="a">The <see cref="UnitValue"/> to multiply</param>
223+
/// <param name="b">The <see cref="double"/> to multiply by</param>
224+
/// <returns>The result of the multiplication operation</returns>
225+
public static UnitValue operator *(double a, UnitValue b)
226+
=> new UnitValue(b.Value * a, b.Unit);
227+
219228
/// <summary>
220229
/// Divide a given <see cref="UnitValue"/> by another <see cref="UnitValue"/>
221230
/// </summary>

0 commit comments

Comments
 (0)