You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had discussed replacing ZERO_TOLERANCE with the old FLT_EPSILON.
Maybe what we should provide here is inline methods instead. ZERO_TOLERANCE is mostly used for comparison - "is this less than zero-ish?" or "is this greater than zero-ish?"
This would make it a bit more readable and eliminate casting issues and warnings.
if (range < CCLib::ZERO_TOLERANCE)
becomes:
if ( CCLib::lessThanEpsilon( range ) )
This might be implemented like this:
inlineboollessThanEpsilon( double x )
{
return x < std::numeric_limits<double>::epsilon();
}
inlineboollessThanEpsilon( float x )
{
return x < std::numeric_limits<float>::epsilon();
}
The text was updated successfully, but these errors were encountered:
I considered that, but wanted to avoid templates as much as possible. I think it's overkill for this. Just causes longer compile times for no real return.
Describe the feature you would like
We had discussed replacing ZERO_TOLERANCE with the old
FLT_EPSILON
.Maybe what we should provide here is inline methods instead. ZERO_TOLERANCE is mostly used for comparison - "is this less than zero-ish?" or "is this greater than zero-ish?"
This would make it a bit more readable and eliminate casting issues and warnings.
if (range < CCLib::ZERO_TOLERANCE)
becomes:
if ( CCLib::lessThanEpsilon( range ) )
This might be implemented like this:
The text was updated successfully, but these errors were encountered: