Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

majji's question

 
Malli Murugan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
System.out.println(Math.min(-0.0,+0.0) == Math.max(0.0,+0.0));
The answer is true;
How?
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Malli,
The == operator treats +0.0 and -0.0 as 0.0, it doesn't recognize the difference. See JLS §15.21.1
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Malli Murugan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jane.
Malli
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic