Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
using integer absolute value function 'abs' when argument is of floating
point type [-Werror,-Wabsolute-value]

Signed-off-by: Tom Hughes <[email protected]>
  • Loading branch information
thughes committed Apr 28, 2018
1 parent b4e2985 commit fc04d2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/src/unit_test_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fc04d2a

Please sign in to comment.