Below is the program i wrote.
class Value
{
public static void main(String [] args)
{
float v=2.234567f;
System.out.println("the valu of v="+v);
}
}
1) When i give the valu of v=2.234567f provide output as "the valu of v=2.234567"
2)When i give the value of v=2.2345678f it provides output as"the valu of v=2.2345679" [ i thought the ouput will 2.2345678]
3)When i give the value of v=2.2345679f it provides output as "the valu of v=2.2345679"[my doubt is for the value of v in step 2 and the value of v in step 3 gives the same output why??].
Thanks in advance for clarifying and looking into my doubt.
Regards,
purni.