Re: [HACKERS] pow support for pgbench - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [HACKERS] pow support for pgbench
Date
Msg-id alpine.DEB.2.20.1711061406320.5606@lancre
Whole thread Raw
In response to Re: [HACKERS] pow support for pgbench  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] pow support for pgbench
List pgsql-hackers
Hello Raúl,

> I've fixed the documentation and added an ipow function that handles both
> positive and negative ints, having 0^0 == 1 and 0^(negative) == PG_INT64_MAX
> since that's what my glibc math.h pow() is returning.

From the comment:
 * For exp < 0 return 0 except when the base is 1 or -1

I think that it should do what POW does in psql, i.e.:
 fabien=# SELECT POW(2, -2); # 0.25

that is if exp < 0 the double version should be used, it should
not return 0.

Basically the idea is that the pgbench client-side version should behave 
the same as the SQL version.

-- 
Fabien.
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [HACKERS] proposal - Default namespaces for XPath expressions(PostgreSQL 11)
Next
From: Konstantin Knizhnik
Date:
Subject: Re: [HACKERS] Secondary index access optimizations