Hi,
I'm trying to print floating point numbers, but I get one extra digit
when I use the g verb. Quoting from print(2),
"... and precision is the maximum number of significant digits for g
and G conversions."; so I expect
print("%.2g\n", 1234.567);
to produce
1.2e+03
but I get
1.23e+03
it seems that print(2) uses printf rules for setting the number of
decimals, which will produce the number of significant digits plus
one. I guess that the man page or the implementation needs to be
corrected, but I could be wrong.
Saludos

-- 
Hugo

Reply via email to