Zulip Chat Archive

Stream: Is there code for X?

Topic: Tried to find something like 'iroot'


Ilmārs Cīrulis (Dec 26 2025 at 23:16):

I tried to find something like "integer root" in Lean and Mathlib, but didn't have any success.

There isn't anything like that, right?

Ilmārs Cīrulis (Dec 26 2025 at 23:21):

That's, like, n-th root of natural number x truncated down to the closest natural number with a boolean that's true if the root is exactly a natural number (the case of x being perfect n-th power).

Weiyi Wang (Dec 26 2025 at 23:23):

docs#Nat.nthRoot ?
(it doesn't return whether it is exactly the root though)

Aaron Liu (Dec 26 2025 at 23:46):

you can test whether it's the nth root exactly by raising it to the nth power

Ilmārs Cīrulis (Dec 27 2025 at 00:31):

Thank you both. :heart:

Ilmārs Cīrulis (Dec 27 2025 at 00:32):

For some reason I didn't find it, that probably means my loogle-fu is bad.


Last updated: Feb 28 2026 at 14:05 UTC