The Answer come 0 and not 1, Why?
public class Student {
public static void main(String[] args) {
double s=1.3901863961920014E-5;
int a= (int)s;
System.out.println("a: "+a);
}
}
The Answer come 0 and not 1, Why?
public class Student {
public static void main(String[] args) {
double s=1.3901863961920014E-5;
int a= (int)s;
System.out.println("a: "+a);
}
}
because your number
1.3901863961920014E-5
Is :
0.000013901863961920014013868597546608185666627832688391208648681640625
You can try to check the full length like this :
double s = 1.3901863961920014E-5;
BigDecimal b = new BigDecimal(s);
System.out.println(b);
=> 0.000013901863961920014013868597546608185666627832688391208648681640625