The CONSTANT_Integer_info and CONSTANT_Float_info structures represent 4-byte numeric (int and float) constants:
CONSTANT_Integer_info {
u1 tag;
u4 bytes;
}
CONSTANT_Float_info {
u1 tag;
u4 bytes;
}
The items of these structures are as follows:
-
tag
The
tagitem of theCONSTANT_Integer_infostructure has the valueCONSTANT_Integer(3).The
tagitem of theCONSTANT_Float_infostructure has the valueCONSTANT_Float(4). -
bytes
The
bytesitem of theCONSTANT_Integer_infostructure represents the value of theintconstant. The bytes of the value are stored in big-endian (high byte first) order.The
bytesitem of theCONSTANT_Float_infostructure represents the value of thefloatconstant in IEEE 754 floating-point single format (§2.3.2). The bytes of the single format representation are stored in big-endian (high byte first) order.The value represented by the
CONSTANT_Float_infostructure is determined as follows. The bytes of the value are first converted into anintconstant bits. Then:-
If bits is
0x7f800000, thefloatvalue will be positive infinity. -
If bits is
0xff800000, thefloatvalue will be negative infinity. -
If bits is in the range
0x7f800001through0x7fffffffor in the range0xff800001through0xffffffff, thefloatvalue will be NaN. -
In all other cases, let
s,e, andmbe three values that might be computed from bits:int s = ((bits >> 31) == 0) ? 1 : -1; int e = ((bits >> 23) & 0xff); int m = (e == 0) ? (bits & 0x7fffff) << 1 : (bits & 0x7fffff) | 0x800000;
Then the
floatvalue equals the result of the mathematical expressions · m · 2^{e-150}. -