Re: float output precision questions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Pedro M(dot) Ferreira" <pfrazao(at)ualg(dot)pt>, Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: float output precision questions
Date: 2002-11-08 04:27:22
Message-ID: 200211080427.gA84RMT27001@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Added to TODO:

* Add GUC variables extra_float_digits and extra_double_digits
to control output digits

---------------------------------------------------------------------------

Tom Lane wrote:
> "Pedro M. Ferreira" <pfrazao(at)ualg(dot)pt> writes:
> > Have two parameters, say DOUBLE_OUTPUT and EXTRA_DIGITS. DOUBLE_OUTPUT
> > would select from decimal output or normalized output. EXTRA_DIGITS
> > would add the required extra digits, from 0 (default) to 3, when output
> > is decimal.
>
> I'm not happy with adding the hex-output option, since it's not
> very portable and doesn't seem necessary to solve the problem anyway.
>
> But I think an EXTRA_DIGITS setting might be interesting. In
> particular, suppose we allowed EXTRA_DIGITS to be negative? Setting
> it to -1 or -2 would go a long way towards eliminating our problems
> with platform variations in the geometry regression test.
>
> Perhaps something like
>
> extra_float_digits int range -2 to 2, default 0
>
> extra_float_digits adjusts the number of digits displayed for float4 and
> float8 output; the base value of 0 means we output FLT_DIG or DBL_DIG
> digits respectively.
>
> Per discussion, there's no reason to allow a value greater than 2, but
> I'm not as sure what the lower limit should be --- maybe there's some
> use in setting it less than -2?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-11-08 04:29:18 Re: Concerns about statement-timeout patch
Previous Message Bruce Momjian 2002-11-08 04:24:20 Re: [HACKERS] PostgreSQL supported platform report and a patch.