Name the type of error for the following expression: double x=-12.0,y=0.0;y=math.sqrt(x)
Answers
Answered by
0
Answer:
If the value of x is negative, Math.sqrt() returns NaN.
Because sqrt() is a static method of Math, you always use it as Math.sqrt(), rather than as a method of a Math object you created (Math is not a constructor
Similar questions
Science,
3 hours ago
English,
3 hours ago
Environmental Sciences,
6 hours ago
Math,
6 hours ago
Social Sciences,
8 months ago
English,
8 months ago
Math,
8 months ago