my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Math.min and Math. max Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Math.min and Math. max" Watch "Math.min and Math. max" New topic
Author

Math.min and Math. max

rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
Why is Math.min(-0.0,+0.0) == Math.max(0.0,+0.0) true..??


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi:
I will return true. However, some platforms use foating point operator which can distenguish between 0 and -0


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Math.min and Math. max
 
Similar Threads
confusion on (==)
(Math.min(-0.0,+0.0) == Math.max(0.0,+0.0));
Doubt in Math class
Math.max and Math.min
[about zero]...