// Newtons approximation to the square root val _sqrt = { int x -> int guess = x; while( 1 ) { int next = (x/guess + guess)/2; if( next == guess ) return guess; guess = next; } }; int cast_int = arg+2; return _sqrt(arg) + _sqrt(cast_int);