• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding the maximum between 3 values II  RSS feed

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i am using Math.max(a, Math.max(b, c)) , but, say, b and c are the same and are both bigger than a, then which does it chose to return?

Thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since they're primitives, not objects, there is no concept of returning one or the other. They're indistinguishable from each other, and from all other variables having the same value.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!