1 diff --git a/src/ipelib/ipebase.cpp b/src/ipelib/ipebase.cpp
2 index 63de035..f4f102e 100644
3 --- a/src/ipelib/ipebase.cpp
4 +++ b/src/ipelib/ipebase.cpp
5 @@ -557,55 +557,9 @@ Stream &Stream::operator<<(int i)
7 Stream &Stream::operator<<(double d)
15 - // PDF will not be able to read this, but we have to write something.
16 - // Such large numbers should only happen if something is wrong.
17 - std::sprintf(buf, "%g", d);
19 - } else if (d < 1e-8) {
22 - // Print six significant digits, but omit trailing zeros.
23 - // Probably I'll want to have adjustable precision later.
38 - factor = 100000000L;
39 - double dd = trunc(d);
40 - int intpart = int(dd + 0.5);
42 - int v = int(factor * (d - dd) + 0.5);
47 - std::sprintf(buf, "%d", intpart);
49 - int mask = factor / 10;
53 - putChar('0' + v / mask);
54 - v = (10 * v) % factor;
59 + std::snprintf(buf, 100, "%.20g", d);