pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Christopher Gernon <kabigon@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values
Date: Tue, 20 Sep 2011 15:05:19 -0400
Message-ID: <12259.1316545519@sss.pgh.pa.us> (raw)
In-Reply-To: <4E789528020000250004141A@gw.wicourts.gov>
References: <201109201717.p8KHHlZU087195@wwwmaster.postgresql.org>
	<4E78899D020000250004140B@gw.wicourts.gov>
	<CAKwX5KiRDRkWKwvPq5XQy43_LdF+1CR51vzGy9MmbVikmYORew@mail.gmail.com>
	<4E789528020000250004141A@gw.wicourts.gov>

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Christopher Gernon <kabigon@gmail.com> wrote:
>> to_char() should be able to convert 5.6e-32 to text just as easily
>> as it can convert 5.6e-3. For some reason, it doesn't.
 
> Oh, I see your point now, and I agree with you.
 
> We should probably at least put this on the TODO list, I think.  Any
> objections?

If we're gonna fix it, we should just fix it, I think.  I was
considering taking a stab at it, but if someone else would like to,
that's fine too.

One other thing I notice in the same area is that the handling of NaNs
and infinities seems a bit incomplete.  There's an explicit special case
for them in the EEEE-format code path, but not otherwise, and I think
that the results you get for other formats will vary depending on what
the local implementation of snprintf does.  What *should* the output be,
if the input is NaN or Inf?

			regards, tom lane



view thread (11+ messages)  latest in thread

Message-ID: <12259.1316545519@sss.pgh.pa.us>
Permalink:  ../12259.1316545519@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12259.1316545519@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, Kevin.Grittner@wicourts.gov, kabigon@gmail.com
  Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values
  In-Reply-To: <12259.1316545519@sss.pgh.pa.us>
  References: <201109201717.p8KHHlZU087195@wwwmaster.postgresql.org> <4E78899D020000250004140B@gw.wicourts.gov> <CAKwX5KiRDRkWKwvPq5XQy43_LdF+1CR51vzGy9MmbVikmYORew@mail.gmail.com> <4E789528020000250004141A@gw.wicourts.gov> <12259.1316545519@sss.pgh.pa.us>

* 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