Re: sprintf() precision arbitrarily at six decimal places?

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

"Slide-rule accuracy" should be enough for everyone.

include std/math.e 
 
? PI 
printf(1, "%f\n", PI ) 
printf(1, "%30.15f\n", PI ) 
 
puts(1,  sprintf("%f", PI ) & "\n" ) 
puts(1,  sprintf("%.50f", PI ) ) 

3.141592654 
3.141593 
             3.141592653589793 
3.141593 
3.14159265358979311599796346854418516159057617187500 

_tom

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

Search



Quick Links

User menu

Not signed in.

Misc Menu