Re: [HACKERS] pow support for pgbench

2017-11-06 Thread Raúl Marín Rodríguez
al, ipow(i1, i2)); > else > // conversion is done by C, no need to coerce again > setDoubleValue(retval, pow(i1, i2)); >} >else >{ > d1, d2 = ...; > setDoubleValue(retval, pow(d1, d2)); >} > > Add a test case to show

Re: [HACKERS] pow support for pgbench

2017-11-06 Thread Raúl Marín Rodríguez
ouble 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. -- *Raúl Marín Rodríguez*carto.com From be2fedcae277f7eede621dcda66b15b08372ce63 Mon Sep 17 00:

Re: [HACKERS] pow support for pgbench

2017-11-06 Thread Raúl Marín Rodríguez
= 1; > while (exp) > { > if (exp & 1) > result *= base; > exp >>= 1; > base *= base; > } > > return result; > } > > The integer version should be when x & y are integers *AND* y >= 0. &

Re: [HACKERS] pow support for pgbench

2017-10-30 Thread Raúl Marín Rodríguez
Sorry about the patch. Attaching it now so it can be considered as submitted. -- *Raúl Marín Rodríguez*carto.com From a6eecfe6637bdb0cbb02a9eda7b88d9c4325bb51 Mon Sep 17 00:00:00 2001 From: Raul Marin <rmrodrig...@cartodb.com> Date: Fri, 13 Oct 2017 17:42:23 +0200 Subject: [PATCH] A

Re: [HACKERS] pow support for pgbench

2017-10-30 Thread Raúl Marín Rodríguez
/alpine.DEB.2.20. > 1710201835390.15170@lancre > > which adds a few functions and operators. > > Good idea. pow() is not added by Fabien's patch, but an operator for > pow() could be something to add as well. > -- > Michael > -- *Raúl Marín Rodríguez*carto.com

[HACKERS] pow support for pgbench

2017-10-30 Thread Raúl Marín Rodríguez
some tests. Please let me know if I'm missing anything. Regards, *Raúl Marín Rodríguez* carto.com From 08a4d519e0c73d0f16acd9e5db9e5b547a884902 Mon Sep 17 00:00:00 2001 From: Raul Marin <rmrodrig...@cartodb.com> Date: Fri, 13 Oct 2017 17:42:23 +0200 Subject: [PATCH] Add pow() support to pgben