floats in (s)printf

new topic     » topic index » view thread      » older message » newer message

i just noticed that printf and sprintf by default display like 6
digits after the decimal place or something like that with %e, %f and %g...
i was wondering it were possible (practical) to have some way of
displaying just enough digits that would still give all the accuracy of the
number...  i.e.  if i were to do a printf(1,"%f",5.5) it would print out
"5.5", but if i were to do a printf(1,"%f",5.55555555555555555) it would
print out that number to 15 decimal places or whatever it is...  you know
what i'm saying??  okay

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu