If two floats happen to be equal, return right away

Covers the cases where infinity == infinity
This commit is contained in:
jsalling
2016-08-23 22:36:02 -05:00
parent 75ad84c92f
commit 3108aba5c7
2 changed files with 4 additions and 4 deletions

View File

@ -683,6 +683,8 @@ void UnityAssertFloatsWithin(const _UF delta,
UNITY_SKIP_EXECUTION;
if (expected == actual) return;
if (diff < 0.0f)
{
diff = 0.0f - diff;
@ -844,6 +846,8 @@ void UnityAssertDoublesWithin(const _UD delta,
UNITY_SKIP_EXECUTION;
if (expected == actual) return;
if (diff < 0.0)
{
diff = 0.0 - diff;