exact-integer-sqrt implemented