The function used integer abs() instead of fabs(), in C abs() only takes integers so this is an error. Also needed to add comparison with absolute tolerance to get reasonable behaviour (comparing 0 versus 0.0000000000001 is ok here).
The function used integer abs() instead of fabs(), in C abs() only takes integers so this is an error. Also needed to add comparison with absolute tolerance to get reasonable behaviour (comparing 0 versus 0.0000000000001 is ok here).