Permalink
Browse files

Fix warning

using integer absolute value function 'abs' when argument is of floating
point type [-Werror,-Wabsolute-value]

Signed-off-by: Tom Hughes <tomtheengineer@gmail.com>
  • Loading branch information...
thughes committed Apr 11, 2018
1 parent b4e2985 commit fc04d2aa18104f3503462b5148d5cdfd22b2ab25
Showing with 1 addition and 1 deletion.
  1. +1 −1 test/src/unit_test_common.c
@@ -78,7 +78,7 @@ void FILL_FLOAT_ARRAY_LIMIT_GT1 (ne10_float32_t *arr, ne10_uint32_t count)
// this function checks whether the difference between two ne10_float32_t values is within the acceptable error range
ne10_int32_t EQUALS_FLOAT (ne10_float32_t fa, ne10_float32_t fb , ne10_uint32_t err)
{ ne10_float32_t tolerance = (ne10_float32_t)err / 200000;
if (abs(fa-fb) <= tolerance)
if (fabs(fa-fb) <= tolerance)
{
return 1;
}

0 comments on commit fc04d2a

Please sign in to comment.