Skip to content

Instantly share code, notes, and snippets.

@kishida
Created January 31, 2016 10:01
Show Gist options
  • Save kishida/d86c577c1ab018c5fa3d to your computer and use it in GitHub Desktop.
Save kishida/d86c577c1ab018c5fa3d to your computer and use it in GitHub Desktop.
Round error
long max = 9_000_000_000_000_000_001L;
System.out.println(max);
double fl = max;
System.out.println(fl);
long max_i = (long) fl;
System.out.println(max_i);
@kishida
Copy link
Author

kishida commented Jan 31, 2016

9000000000000000001
9.0E18
9000000000000000000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment