On the vast majority of modern platforms, the default size for the CPU is 32 bits by default, as well as the size of the float, so we assume that the conversion between the two results does not lead to unexpected results. You probably already know this, but integers cannot be declared unsigned in Java, although you can specify a hexadecimal value corresponding to one. The actual conversion, as demonstrated by rlibby and Mr. Powers, is trivial, since the bit is simply interpreted differently. However, this method can be useful in several scenarios where you can try to combine with binary data. There are several useful custom tricks, such as those described here , that are based on using the IEEE 754 float view; perhaps somewhere along the line, this method can be used when it becomes necessary to translate between integer and floating representations of bits.
source share