Answers for "nearly equal float"

1

nearly equal float

#include <cfloat>
bool nearlyEqual(float a, float b) {
	return std::abs(a - b) < FLT_EPSILON;
}
Posted by: Guest on August-02-2020

Browse Popular Code Answers by Language