Created
September 8, 2020 02:00
-
-
Save PastaPastaPasta/a80a411e04f332ee8272365085a04db6 to your computer and use it in GitHub Desktop.
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
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