Take a float absolute value using fabs() instead of abs().
Replace integer abs() by floating point fabs() in the approximate equality check for float values.
This commit is contained in:
@@ -63,7 +63,7 @@ int main (void)
|
|||||||
|
|
||||||
res = (((cls_ret_double)code))(0.1, 0.2, 0.3, 0.4, 5, 0.6, 0.7, 0.8, 0.9, 10,
|
res = (((cls_ret_double)code))(0.1, 0.2, 0.3, 0.4, 5, 0.6, 0.7, 0.8, 0.9, 10,
|
||||||
1.1, 12, 1.3, 14, 1.5, 16);
|
1.1, 12, 1.3, 14, 1.5, 16);
|
||||||
if (abs(res - expected) < FLT_EPSILON)
|
if (fabs(res - expected) < FLT_EPSILON)
|
||||||
exit(0);
|
exit(0);
|
||||||
else
|
else
|
||||||
abort();
|
abort();
|
||||||
|
|||||||
Reference in New Issue
Block a user