In both cases we'd return a double but we use the fast ipow if it's possible (which can be 20x faster), so at the cost of an extra cast if you need an int, we'd have a consistent API. Would this be acceptable?

It seems OK to me.

Computing as an int, casting to double and back to int8 can generate a loss of precision. However for powers of 2 it works exactly, so eg computing a mask it would be ok.

This proposal does not exactly match SQL behavior, but I do not see this as a problem, which is why I was happy with the previous proposal.

--
Fabien.

Reply via email to