Yes, -Float.MAX_VALUE is the negative number with largest magnitude. floats are represented the same way as doubles, just with half the storage space (and the accompanying loss of precision.) Since signs in IEEE 754 are represented by a single bit, flipping that bit doesn't change the overall magnitude attainable by the remaining bits.
Yes, -Float.MAX_VALUE is the negative number with largest magnitude. floats are represented the same way as doubles, just with half the storage space (and the accompanying loss of precision.) Since signs in IEEE 754 are represented by a single bit, flipping that bit doesn't change the overall magnitude attainable by the remaining bits.
Yes - it's the same bit pattern as Float.MAX_VALUE except with the sign bit flipped... and that's another way to get at the value:
public class Test {
public static void main(String[] args) {
// Float.MAX_VALUE is intBitsToFloat(0x7f7fffff)
// so we set the most significant bit - the sign bit
float f = Float.intBitsToFloat((int) 0xff7fffff);
System.out.println(f == -Float.MAX_VALUE); // true
}
}