Heres what I dont understand. If I have value = 157.8926 and I want to print that value. Why does %g give 157.893 and %f give 157.892600. I thought they would give the same value since %g is supposed to use %f or %e, depending on which is shorter in character length. Since %f would be shorter, it would use %f. So why does it give different values. Example code is shown below.
I realize that. The input is just for an example. Whether I use %lf or %f, I still get 157.892600. Does anyone know why %f gives a different value than %g (or %lf and %lg).