Re: Purpose of rscale/dscale in NUMERIC?

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Purpose of rscale/dscale in NUMERIC?
Date: 2002-10-02 15:09:10
Message-ID: 3D9B0C16.BF0FC7E9@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> > Tom Lane wrote:
> >> What is the reason for maintaining separate rscale and dscale values in
> >> numeric variables?
>
> > You need to carry around a decent number of digits when you divide
> > already. Exposing them in a manner that numericcol(15,2) / 3.0 all of
> > the sudden displays 16 or more digits isn't much more intuitive. But
> > carrying around only 2 here leads to nonintuitively fuzzy results on the
> > other hand.
>
> Certainly you need extra guard digits while you do the calculation.
> What I'm wondering is why the delivered result would have hidden digits
> in it. If they're accurate, why not show them? If they're not accurate
> (which they're not, at least in the case I showed) why is it a good idea
> to let them escape?

So we need them in the calculation, and if it's a nested tree of
function calls, they have to travel around too. What do you think is a
good place to kill these critters then?

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-02 15:14:08 Re: (Fwd) Re: Any Oracle 9 users? A test please...
Previous Message Tom Lane 2002-10-02 15:06:31 Re: pg_dump and large files - is this a problem?