Re: %g format again

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

rforno writes:
> Why the last item in the following line is printed with only 5 decimals?
>
> printf(1, "%g %g %g %g %g\n", {5, 5.00, 5.100000, 5.1200000, 5.12345678})
> 
> 5 5 5.1 5.12 5.12346

I'm using C's %g to implement Euphoria's %g.
I guess 5 is the default chosen by the C implementers.
If you want more digits you can specify a field width and a precision.
Try some experiments.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu