pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Erik Wienhold <ewie@ewie.name>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Exponentiation confusion
Date: Thu, 13 Oct 2022 15:12:31 -0400
Message-ID: <1064007.1665688351@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEZATCXEJGLE5h93f2LuaRYomF50SGa2vtQBHRZrZXtEjdft1Q@mail.gmail.com>
References: <12a40226-70ac-3a3b-3d3a-fdaf9e32d312@aklaver.com>
	<603008316.190107.1665680007674@office.mailbox.org>
	<979360.1665681418@sss.pgh.pa.us>
	<CAEZATCXEJGLE5h93f2LuaRYomF50SGa2vtQBHRZrZXtEjdft1Q@mail.gmail.com>

Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> The most obvious thing to do is to try to make power_var_int() choose
> the same result rscale as power_var() so that the results are
> consistent regardless of whether the exponent is an integer.

Yeah, I think we should try to end up with that.

> It's worth noting, however, that that will cause in a *reduction* in
> the output rscale rather than an increase in some cases, since the
> power_var_int() code path currently always chooses an rscale of at
> least 16, whereas the other code path in power_var() uses the rscales
> of the 2 inputs, and produces a minimum of 16 significant digits,
> rather than 16 digits after the decimal point.

Right.  I think this is not bad though.  In a lot of cases (such
as the example here) the current behavior is just plastering on
useless zeroes.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <1064007.1665688351@sss.pgh.pa.us>
Permalink:  ../1064007.1665688351@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1064007.1665688351@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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dean.a.rasheed@gmail.com, ewie@ewie.name, adrian.klaver@aklaver.com
  Subject: Re: Exponentiation confusion
  In-Reply-To: <1064007.1665688351@sss.pgh.pa.us>
  References: <12a40226-70ac-3a3b-3d3a-fdaf9e32d312@aklaver.com> <603008316.190107.1665680007674@office.mailbox.org> <979360.1665681418@sss.pgh.pa.us> <CAEZATCXEJGLE5h93f2LuaRYomF50SGa2vtQBHRZrZXtEjdft1Q@mail.gmail.com> <1064007.1665688351@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