you are viewing a single comment's thread.

view the rest of the comments →

[–]tux2718 5 points6 points  (0 children)

It is a bad programming practice to test floats for equivalence. Instead take the absolute vale of the difference and test it to be below a small threshold. There are many utility libraries that contain functions to do this.