FIX Cast from int to double in sqrt.