MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / marginComparison

Function marginComparison

unittests/catch.hpp:4624–4626  ·  view source on GitHub ↗

Performs equivalent check of std::fabs(lhs - rhs) <= margin But without the subtraction to allow for INFINITY in comparison

Source from the content-addressed store, hash-verified

4622// Performs equivalent check of std::fabs(lhs - rhs) <= margin
4623// But without the subtraction to allow for INFINITY in comparison
4624bool marginComparison(double lhs, double rhs, double margin) {
4625 return (lhs + margin >= rhs) && (rhs + margin >= lhs);
4626}
4627
4628}
4629

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected