A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Finding the maximum between 3 values II
Joined: Nov 21, 2004
Nov 12, 2005 03:37:00
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?
Moosey knows best
Joined: Mar 22, 2005
Nov 12, 2005 04:27:00
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.
Ping & DNS
- my free Android networking tools app
I agree. Here's the link:
subject: Finding the maximum between 3 values II
Kathy's book - chapter 6 - question #7
Finding the maximum between 3 values?
pick the largest, second and third number from an array
compare three double numbers
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014