Tolerate IEEE-754 precision in VALUE time-difference test

VALUE("16:48:00") - VALUE("12:00:00") evaluates to 0.19999999999999996
due to standard IEEE-754 floating-point subtraction error, not 0.2.
Add precision: 10 to the Assert.Equal — well within the actual error
magnitude (1e-16) and matching the test's intent (the time-fraction
should be 0.2 to within meaningful precision).
This commit is contained in:
Atanas Korchev
2026-05-27 15:16:32 +03:00
committed by Vladimir Enchev
parent 399f445f70
commit 7f7aeb262d

View File

@@ -18,6 +18,6 @@ public class ValueFunctionTests
{
var sheet = new Worksheet(10, 10);
sheet.Cells["A1"].Formula = "=VALUE(\"16:48:00\")-VALUE(\"12:00:00\")";
Assert.Equal(0.2d, sheet.Cells["A1"].Data.Value);
Assert.Equal(0.2d, (double)sheet.Cells["A1"].Data.Value!, precision: 10);
}
}