| From: | Rob Sargent <robjsargent(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general(at)lists(dot)postgresql(dot)org |
| Subject: | Re: integer square root function proposed |
| Date: | 2022-12-18 03:20:21 |
| Message-ID: | a6c1675b-4ca9-69f6-ec6e-3cdebab59d25@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On 12/17/22 19:39, Martin L. Buchanan wrote:
> Dear PostgreSQL colleagues:
>
> I have just joined this, my first PG mailing list.
>
> Reading the documentation I found no built-in function for integer
> square root, requiring a sequence of:
>
> floor(sqrt(foo))::integer
>
> to go from an integer to the integer square root as an integer.
>
> If PG leaders smile on this suggestion, could we have *isqrt*(foo)
> where foo has a numeric type and the result type is the same numeric
> type, with the result type being the integer square root for foo >= 0
> and producing an error if negative? (And with infinities and NaNs
> processed as described in 8.1 Numeric Types).
>
> I did not see an explicit enhancement request list in the PG mailing
> lists. Recommendations for a more specific list to post this to are
> welcome.
>
>
I suspect the majority are comfortable getting a non-integer result for
the square root of a number. What environment have you which needs
(sqrt(a) * sqrt(a)) < a-epsilon?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Martin L. Buchanan | 2022-12-18 03:40:01 | Re: integer square root function proposed |
| Previous Message | Martin L. Buchanan | 2022-12-18 02:39:44 | integer square root function proposed |