PG Bug reporting form <noreply@postgresql.org> writes:
> In practice a 7-significant-digit value is stored exactly
Some of them are, but please don't claim that on the strength of
one test case.
> but printed with 6 digits:
> CREATE EXTENSION seg;
> SELECT '1234567'::seg AS printed,
> seg_lower('1234567'::seg)::float8 AS stored,
> '1234567'::seg::text::seg = '1234567'::seg AS round_trips;
I do not think this is a code bug. The code clearly intends to render
values exactly as long as they're no more than FLT_DIG digits wide,
and it accomplishes that, and it cannot expect to do more because
the underlying storage can't promise more.
It does seem like a documentation bug that the docs are written
as if FLT_DIG were 7. That's not so on any modern platform,
and even when these docs were written I doubt that anything had
that.
regards, tom lane