[cairo] Changing %f to %g in cairo-output-stream.c?

Bill Spitzak spitzak at d2.com
Fri Oct 20 11:55:13 PDT 2006

Where I work we write quite huge files out with ascii floating point 
numbers in them, and %g really is a big win and is used all the time. In 
fact it helps to further modify it to remove the leading 0 from numbers 
between -1 and 1. Believe me, the reduction in file size makes a 
difference. So I do recommend doing this.

Behdad Esfahbod wrote:
> Hi,
> While working on Pango Postscript output from Firefox I noticed that we
> are using %f to print double values in cairo-output-stream.c.  Shouldn't
> we be using %g instead?  The difference is that %g generates a shorter
> representation than %f.  For example, printing 0.3, %g will print 0.3,
> while %f prints 0.30000.

More information about the cairo mailing list