On Tuesday, March 12, 2024, PG Bug reporting form <
noreply@postgresql.org> wrote:
The following bug has been logged on the website:
Bug reference: 18390
Logged by: Robb Allan
Email address: robb@helical.com
PostgreSQL version: 15.5
Operating system: Mac OS Sonoma 14.3.1 (23D60)
Description:
However, an nth-root calculation from that float result does NOT produce a
new float result:
funds=# select (2.5937424601000000^(1/10));
?column?
--------------------
1.0000000000000000
(1 row)
1.000000000000…. Is a float.
The issue is you expect dividing two integers to produce a float but that isn’t how that works. Dividing two integers produces an integer. In this case zero, or .1 rounded down/truncated.
David J.