Skip to content

Question: Default equality precision #717

Closed
@dschuermans

Description

@dschuermans

Hey,

I'm wondering if there's anything done concerning default equality functionality...
From the docs i found that precision is being tested up to 1E-5.

However, when doing the following:

Length unit2 = Length.FromFeet(10D * 3.28084D)

Assert.AreEqual(unit1, unit2)
Assert.IsTrue(unit1.Equals(unit2)

the test fails.

However:
unit1.Equals(unit2, 1E-5, ComparisonType.Absolute)
will return true.

The value in meters for unit2 is 10.00000032

Should we always use the overloaded Equals methods or is there a way we can configure the default Equals?

Metadata

Metadata

Assignees

Labels

pinnedIssues that should not be auto-closed due to inactivity.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions