aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Math.min Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Math.min" Watch "Math.min" New topic
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
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Math.min
 
Similar Threads
links to Abilash site, Free Beta exam
I need Abhilash Mock Test's Answers.
SCJP doubt
FlowLayout
Private/Protected interfaces