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:
An exponentiation from a float produces a floating point result:
funds=# select (1.1^10);
?column?
--------------------
2.5937424601000000
(1 row)
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)
Only when the root factors are floats does the result coerce to a float:
funds=# select (2.5937424601000000^(1.0/10));
?column?
------------------------
1.10000000000000000000
(1 row)
funds=# select (2.5937424601000000^(1/10.0));
?column?
------------------------
1.10000000000000000000
(1 row)