Skip to content

Instantly share code, notes, and snippets.

@PastaPastaPasta
Created September 8, 2020 02:00
Show Gist options
  • Save PastaPastaPasta/a80a411e04f332ee8272365085a04db6 to your computer and use it in GitHub Desktop.
Save PastaPastaPasta/a80a411e04f332ee8272365085a04db6 to your computer and use it in GitHub Desktop.
public class TestDoubleIntConv {
public static void main(String args[]) {
double init = 0.58;
double init100 = init * 100;
int initInt = (int) init100;
System.out.printf("init: %f, init100: %f, initInt: %d\n", init, init100, initInt);
// init: 0.580000, init100: 58.000000, initInt: 57
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment