Skip site navigation (1) Skip section navigation (2)

Re: BUG #6217: to_char() gives incorrect output for very small float values

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Chris Gernon" <kabigon(at)gmail(dot)com>,<pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values
Date: 2011-09-20 17:39:57
Message-ID: 4E78899D020000250004140B@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-bugs
"Chris Gernon" <kabigon(at)gmail(dot)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

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2011-09-20 17:49:28
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values
Previous:From: Chris GernonDate: 2011-09-20 17:17:47
Subject: BUG #6217: to_char() gives incorrect output for very small float values

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group