Dear Rob and all readers:
Generating prime numbers is one example where you use integer square root in the inner loop, going from integer to integer.
Calculating an integer square root from an integer input may have a more efficient algorithm than doing so in floating-point, with the caveat that an underlying processor architecture may provide floating-point square root instructions but not integer square root instructions. In that particular case an implementation could use the floating-point instructions internally.
Some but not all programming languages provide isqrt directly, math.isqrt in Python or isqrt in Common Lisp for example.
It would be a useful and convenient function and would not, I believe, impair the other features of PostgreSQL in any way.
That said, as a PG novice (2+ years now), I completely defer to the greater wisdom of those much more involved in PostgreSQL. So something for you all to think about.
Best wishes, Happy Channukah, and Merry Christmas,
Martin L. Buchanan
software developer and writer since 1976
Laramie, WY