negative value handling in sqrt