Perhaps you want the result to be an Int as well?
isqrt :: Int -> Int
isqrt = floor . sqrt . fromIntegral
You may want to replace floor with ceiling or round.
(BTW, this function has a more general type than the one I gave.)
Perhaps you want the result to be an Int as well?
isqrt :: Int -> Int
isqrt = floor . sqrt . fromIntegral
You may want to replace floor with ceiling or round.
(BTW, this function has a more general type than the one I gave.)