Created
June 4, 2015 05:05
-
-
Save vaskoz/f08bfaabc941aaa88880 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class TooSmall { | |
public static void main(String[] args) { | |
double start = 0.1; | |
double tooSmall = 1.0e-18; | |
for (int i = 0; i < 1_000_000_000; i++) { | |
start += tooSmall; | |
} | |
System.out.println(start == 0.1); // TRUE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment