[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proposal: assert_double_close and assert_double_allclose


This is a proposal for two new functions; original post is on github:


moving discussion to the ML.

For numerical applications we sometimes need to test if floating point
numbers are correct.

two useful functions are

int assert_double_close(double a, double b, double rtol, double atol);

int assert_double_allclose(double *a, double * b, int size, double
rtol, double atol);

The behaviour of these functions can be modelled after the testing
functions in numpy:


I'd like to start working on a PR, if there are no other considerations
that these functions were not included in cmocka.


- Yu