Skip to content

Commit 6f2b541

Browse files
committed
Cover an exact operand on either side of a multiplication or division
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QBrEwaLGeo2SvjVK3AnLrp
1 parent f4a8f8c commit 6f2b541

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎SignificantNumber.Test/SignificantNumberExactOperandTests.cs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,21 @@ public void CompareTo_ExactOperands_IsAntisymmetric()
8080
}
8181
}
8282
}
83+
84+
[TestMethod]
85+
[DataRow("1", "1.23", "1.23")]
86+
[DataRow("-1", "1.23", "-1.23")]
87+
[DataRow("1.23", "1", "1.23")]
88+
[DataRow("1.23", "-1", "-1.23")]
89+
[DataRow("0", "1.23", "0")]
90+
[DataRow("1.23", "0", "0")]
91+
public void Multiply_OneExactOperand_KeepsTheOtherOperandsPrecision(string left, string right, string expected) =>
92+
Assert.AreEqual(Parse(expected), Parse(left) * Parse(right));
93+
94+
[TestMethod]
95+
[DataRow("1.23", "1", "1.23")]
96+
[DataRow("1.23", "-1", "-1.23")]
97+
[DataRow("1", "4.1", "0.24")]
98+
public void Divide_OneExactOperand_KeepsTheOtherOperandsPrecision(string left, string right, string expected) =>
99+
Assert.AreEqual(Parse(expected), Parse(left) / Parse(right));
83100
}

0 commit comments

Comments
 (0)