We cannot test smaller than our constant epsilon

This commit is contained in:
2025-10-09 12:01:01 +02:00
parent 2ab59437fa
commit 634ad96ecf

View File

@@ -66,8 +66,8 @@ func TestCompareFloats(t *testing.T) {
}, },
{ {
name: "very small numbers a < b", name: "very small numbers a < b",
a: 1e-15, a: 1e-9,
b: 2e-15, b: 2e-9,
expected: -1, expected: -1,
}, },
@@ -87,13 +87,13 @@ func TestCompareFloats(t *testing.T) {
{ {
name: "zero less than small positive", name: "zero less than small positive",
a: 0.0, a: 0.0,
b: 1e-20, b: 1e-9,
expected: -1, expected: -1,
}, },
{ {
name: "zero greater than small negative", name: "zero greater than small negative",
a: 0.0, a: 0.0,
b: -1e-20, b: -1e-9,
expected: 1, expected: 1,
}, },