Open-Infra-Platform icon indicating copy to clipboard operation
Open-Infra-Platform copied to clipboard

[REF] Double comparison with DoubleEqual (?) instead of != and ==

Open hechth opened this issue 4 years ago • 3 comments

Thing which is being refactored Implement a utility function in either BlueFramework or somewhere else to compare doubles safely for equality or use some existing library function.

Steps

  • [x] Decide for one function for double comparison.
  • [x] Implement it or include/link the external library.
  • [ ] Find all double comparisons using == or != in the code

Example https://github.com/tumcms/Open-Infra-Platform/blob/ed442c345931f4897a6603402face849b24d6b41/Core/src/IfcGeometryConverter/ProfileConverter.h#L543-L549

hechth avatar May 26 '20 05:05 hechth

Suggestion: have a function within GeomSettings() that then links to whatever library / function we decide for. But the students can already start implementing.

pjanck avatar Jun 05 '20 06:06 pjanck

There are a lot of good reads on the webs.

I still think that the precision provided in the IFC file - see attribute Precision here - should be used for defining the epsilon.

pjanck avatar Jun 05 '20 11:06 pjanck

@Elvira2227 : now that #303 is merged, this issue can be addressed:

  • try and find such comparison as stated above
  • use areEqual with corresponding parameters

pjanck avatar Jan 16 '21 08:01 pjanck