Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

approximate float/number comparison assertions in eunit #10

Open
richcarl opened this issue Jul 6, 2012 · 0 comments
Open

approximate float/number comparison assertions in eunit #10

richcarl opened this issue Jul 6, 2012 · 0 comments

Comments

@richcarl
Copy link
Owner

richcarl commented Jul 6, 2012

There should be macros in eunit for asserting that 1) a float (or any number) is within some epsilon from some other number (absolute error), 2) that the relative error is within some percentage, 3) that two numbers are "close". It is unclear if all of these are needed, or just 1-2, or even just 1.

References:

http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm

http://www.boost.org/doc/libs/1_35_0/libs/test/doc/components/test_tools/floating_point_comparison.html

http://www.cs.otago.ac.nz/staffpriv/ok/software.htm (pcfpcmp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant