From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | "robb(at)helical(dot)com" <robb(at)helical(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
Subject: | Re: BUG #18390: exponentiation produces float datatype, but nth-root produces integer |
Date: | 2024-03-13 12:07:35 |
Message-ID: | CAKFQuwYyJT+HFcOqGA5nawKA4yOnMdbGdqRkKbBLZ5KWFzcg7Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Tuesday, March 12, 2024, PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:
> The following bug has been logged on the website:
>
> Bug reference: 18390
> Logged by: Robb Allan
> Email address: robb(at)helical(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Laurenz Albe | 2024-03-13 13:00:29 | Re: BUG #18391: not able to create a new cluster using init db on rocky linux.We are forced to download version 1 3 |
Previous Message | PG Bug reporting form | 2024-03-13 11:18:25 | BUG #18391: not able to create a new cluster using init db on rocky linux.We are forced to download version 1 3 |