Re: BUG #6217: to_char() gives incorrect output for very small float values - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6217: to_char() gives incorrect output for very small float values
Date
Msg-id 12259.1316545519@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #6217: to_char() gives incorrect output for very small float values  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: BUG #6217: to_char() gives incorrect output for very small float values  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-bugs
"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

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values
Next
From: Christopher Gernon
Date:
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values