Created
April 13, 2013 14:41
-
-
Save nedzadarek/5378674 to your computer and use it in GitHub Desktop.
Comparing 2 floats equality based on how different they are.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bezwgledna(float a) if (a<0) return (a-(2*a)); else return a; | |
if ( bezwgledna(liczba_float1 - liczba_float2) < 0.0001 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment