| Author |
Math.min
|
Radouane
Greenhorn
Joined: Aug 01, 2003
Posts: 21
|
|
this code is from the http://www.angelfire.com/or/abhilash/Main.html : System.out.println(Math.min(Float.NaN, Float.POSITIVE_INFINITY)); the result gives NaN 1-can anyone explain to me why NaN ? 2- do we get questions like this in the exam? Thanks
|
 |
Krishna Srinivasan
Ranch Hand
Joined: Jul 28, 2003
Posts: 1803
|
|
NaN-NotaNumber u can get like these questions in the exams when u trying to do any arithmetic operations like 0.0/0.0 0.0/-0.0 0/0.0 Math.sqrt(-1) // we cannot find sqrt for negative number i will always give NaN anything comparison with NaN always will return false eg: (Float.NaN==Float.NaN) will return false OK bye,
|
Krishna Srinivasan
OCAJP Mock Questions
|
 |
 |
|
|
subject: Math.min
|
|
|