Hmmmm. It looks like I reinvented the wheel :p The isqrt/1 (commented out) function is at lib/ssh/src/ssh_math.erl Lessons: read the code before you try to write :p Kenji Rikitake