summaryrefslogtreecommitdiff
path: root/src/cairo-output-stream.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2007-10-31 02:41:33 -0400
committerBehdad Esfahbod <behdad@behdad.org>2007-10-31 02:41:33 -0400
commit8297daff896ca9d803959edb3c1955977594fab9 (patch)
tree99f761334c3024caa663532f6c05003c6cabd712 /src/cairo-output-stream.c
parent04793175ace1312ac88570407ee28db4dde9a93c (diff)
[cairo-output-stream] Write out floats to 18 digits after decimal point
We write floats using %f as the scientific format used by smarter %g is invalid in PS/PDF. %f however by default rounds to five digits after decimal point. This was causing precision loss and making the newly added degenerate-pen test fail for PDF. We now print up to 18 digits which is as many bits doubles can accomodate. We can be smarter, but that's for another commit.
Diffstat (limited to 'src/cairo-output-stream.c')
-rw-r--r--src/cairo-output-stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c
index 5bce0e34..6d9c733c 100644
--- a/src/cairo-output-stream.c
+++ b/src/cairo-output-stream.c
@@ -236,7 +236,7 @@ _cairo_dtostr (char *buffer, size_t size, double d)
if (d == 0.0)
d = 0.0;
- snprintf (buffer, size, "%f", d);
+ snprintf (buffer, size, "%.18f", d);
locale_data = localeconv ();
decimal_point = locale_data->decimal_point;