1. printf %g format
- Posted by rforno at tutopia.com
Nov 01, 2001
Rob:
Wouldn't be possible to modify the %g format so that it prints more than 4
decimals in case they are not zero?
2. Re: printf %g format
rforno writes:
> Wouldn't be possible to modify the %g format so that it prints more than 4
> decimals in case they are not zero?
You can use field-width and precision specifiers
with %g, just as with %f, %s, etc.
For example...
atom x
x = 1.12345678901234
printf(1, "%g", x)
printf(1, "%15.12g", x)
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
3. Re: printf %g format
- Posted by rforno at tutopia.com
Nov 02, 2001
Yes, I know. Maybe I was not clear. I was referring to the default, that is,
only %g.
----- Original Message -----
From: "Robert Craig" <rds at RapidEuphoria.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: printf %g format
>
>
> rforno writes:
> > Wouldn't be possible to modify the %g format so that it prints more than
4
> > decimals in case they are not zero?
>
> You can use field-width and precision specifiers
> with %g, just as with %f, %s, etc.
>
> For example...
>
> atom x
> x = 1.12345678901234
> printf(1, "%g", x)
> printf(1, "%15.12g", x)
>
> Regards,
> Rob Craig
> Rapid Deployment Software
> http://www.RapidEuphoria.com
>
>
>