[Issue 15881] approxEqual Ignores maxAbsDiff

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Oct 19 07:22:21 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15881

--- Comment #3 from John Hall <john.michael.hall at gmail.com> ---
If I were designing it from the start, I probably would have used a function
like 
bool approxEqual(T, U, V)(T lhs, U rhs, V maxDiff, bool isAbsolute = FALSE); 

This way you can easily switch from one to the other. It wouldn't break any
code to add this as an additional option. 

The other one could be fixed so as to match the documentation. This would mean
that there is the simple one that's an OR and another version that can handle
the AND case (which some people still might need).

--


More information about the Digitalmars-d-bugs mailing list