Re: float output precision questions

From: "Pedro M(dot) Ferreira" <pfrazao(at)ualg(dot)pt>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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-10-31 18:15:03
Message-ID: 3DC17327.8010308@ualg.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I sent an email before receiving the one below. I am happier also with
the extra_digits way (from the previous email I thought the options were
DBL_DIG or DBL_DIG+2).

> 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.

Agree.

> 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.

Agree.

>
> 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?

I could see some use. At least in my type of application. When people
are shure they only need p significant digits, they can set
extra_float_digits to an apropriate negative value and spare a lot in
storage for dumps and backups. In this case it would make sense to let
extra_float_digits go to -13.

Regards,
Pedro
>
> 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
>
>

--
----------------------------------------------------------------------
Pedro Miguel Frazao Fernandes Ferreira
Universidade do Algarve
Faculdade de Ciencias e Tecnologia
Campus de Gambelas
8000-117 Faro
Portugal
Tel./Fax: (+351) 289 800950 / 289 819403
http://w3.ualg.pt/~pfrazao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Barry Lind 2002-10-31 18:27:03 Re: PG functions in Java: maybe use gcj?
Previous Message Tom Lane 2002-10-31 18:03:36 Re: 7.2.3 vacuum bug