Skip to content

Instantly share code, notes, and snippets.

@petesh
Created September 17, 2018 10:08
Show Gist options
  • Save petesh/bc7dc296faf9234bc8f72d8ad456a770 to your computer and use it in GitHub Desktop.
Save petesh/bc7dc296faf9234bc8f72d8ad456a770 to your computer and use it in GitHub Desktop.
// Display the difference between a float being printed
// and a double being printed.
public class foo {
public static void main(String[] args) {
float valuef = 2.0f/3;
double valued = 2.0/3;
System.out.println(valuef);
System.out.println(valued);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment