Why am I not getting expected output when using the String.format() function? The answer should be 123456789.123456789 right?
main()
{
float a = 123456789.123456789f;
System.out.println(String.format("%f", a)); // Actual Output: 123456792.000000
System.out.println(String.format("%.4f", a)); // Actual Output: 123456792.0000
System.out.println(String.format("%.4f", a)); // Actual Output: 123456792.0000
}