cmocka icon indicating copy to clipboard operation
cmocka copied to clipboard

functions for testing floating point numbers.

Open rainwoodman opened this issue 6 years ago • 2 comments

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

two few 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:

https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.testing.assert_allclose.html

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

rainwoodman avatar Dec 04 '17 04:12 rainwoodman

@cryptomilk Or am I supposed to move the disucssion to cmocka.org?

rainwoodman avatar Dec 04 '17 04:12 rainwoodman

Yes, please use the cmocka mailinglist

cryptomilk avatar Dec 04 '17 06:12 cryptomilk

Hi all. I'm going to close this one since this is a fork of cmocka. I'm suggesting moving questions to the upstream repository. But questions are always welcome.

diasbruno avatar Apr 10 '24 12:04 diasbruno