Modified Math.sqrt() and test cases