hi friends go through following code:
class test{
public static void main(
String agr[]){
float f=Float.parseFloat(agr[0]);
int i=(int)f;
System.out.println("whole no is "+i);
System.out.println("subtraction is "+(f-i));
}
}
generates output when i give no 25.48(or any other float) as
whole no is 25
subtraction is 0.47999954
where the o/ should be:
whole no is 25
subtraction is 0.48
why so?