-Double.MAX_VALUE is the lowest (as in, < more other values than any other double) double value that isn't an infinity.
Doubles are just numbers with an explicit sign bit. To flip the sign on a double, all you do is flip the sign bit. It's not like integers where you use 2's complement. There are thus also 2 0s (+0 and -0). On Oct 18, 1:45 pm, Casper Bang <casper.b...@gmail.com> wrote: > Dah, should have said -Double.MAX_VALUE (possibly -Double.MAX_VALUE+1, > not sure). > > On Oct 18, 1:19 pm, Casper Bang <casper.b...@gmail.com> wrote: > > > > > > > > > > If the smallest double value held -Double.MAX_VALUE what would the > > > constant > > > holding the smallest possible double value would be called - > > > Double.POSITIVE_SMALLEST_VALUE ? > > > Frankly I have no need for such constant, what I often DO need to > > know, is the lowest value I can represent within the type. Most would > > expect the concept of "min" and "max" to be independent of internal > > representation of sign, fraction and exponent. An implementation of > > Comparable<Temperature> should revolve around less-than, equals and > > greater-than; assuming Double.MIN_VALUE would be well below absolute > > zero (a mere -273.15 celcius). > > Since Double has MIN_EXPONENT and MAX_EXPONENT, it would make sense if > > the current MIN_VALUE and MAX_VALUE had been named MIN_FRACTION and > > MAX_FRACTION instead. In Java and JavaScript, in order to get the > > minimum non-infinite value, you thus have to use -Double.MIN_VALUE > > (possibly -Double.MIN_VALUE+1, not sure). > > > > Do you suggest that Double.MAX_VALUE hold > > > infinity ? > > > Nope, there's already a Double.POSITIVE_INFINITY - there's a > > difference between infinity and the largest number you can represent. > > By definition, the former will always be greater than the latter. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javapo...@googlegroups.com. To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.