From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Chris Gernon <kabigon@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values
Date: Tue, 20 Sep 2011 12:39:57 -0500
Message-ID: <4E78899D020000250004140B@gw.wicourts.gov> (raw)
In-Reply-To: <201109201717.p8KHHlZU087195@wwwmaster.postgresql.org>
References: <201109201717.p8KHHlZU087195@wwwmaster.postgresql.org>
"Chris Gernon" <kabigon@gmail.com> wrote:
> The to_char() function gives incorrect output for float values
> whose decimal expansion has several digits (more than somewhere
> around 14-15) after the decimal point.
These are approximate data types. On what basis do you think the
values returned in your examples are wrong? The demonstrated
results don't surprise me, given that they match to about the limits
of the approximate data type involved. It also wouldn't surprise me
to see slightly different results on different architectures or
operating systems. If you want exact values, you should use a type
which supports that, like numeric.
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, kabigon@gmail.com
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values
In-Reply-To: <4E78899D020000250004140B@gw.wicourts.gov>
References: <201109201717.p8KHHlZU087195@wwwmaster.postgresql.org> <4E78899D020000250004140B@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox