---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 15 Edition"
java_version: 15
chapter: "Chapter 4. The class File Format"
section: "4.4.4"
heading: "4.4.4. The CONSTANT_Integer_info and CONSTANT_Float_info Structures"
parent: "4.4. The Constant Pool"
source: https://docs.oracle.com/javase/specs/jvms/se15/html/jvms-4.html#jvms-4.4.4
id: "4.4.4"
url: https://jvm.obfuscated.software/jvms/se15/4.4.4.html
raw: https://jvm.obfuscated.software/jvms/se15/4.4.4.md
---

# 4.4.4. The `CONSTANT_Integer_info` and `CONSTANT_Float_info` Structures

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 `tag` item of the `CONSTANT_Integer_info` structure has the value `CONSTANT_Integer` (3).

  The `tag` item of the `CONSTANT_Float_info` structure has the value `CONSTANT_Float` (4).

- **bytes**

  The `bytes` item of the `CONSTANT_Integer_info` structure represents the value of the `int` constant. The bytes of the value are stored in big-endian (high byte first) order.

  The `bytes` item of the `CONSTANT_Float_info` structure represents the value of the `float` constant in IEEE 754 binary32 floating-point format ([§2.3.2](2.3.2.md)). The bytes of the item are stored in big-endian (high byte first) order.

  The value represented by the `CONSTANT_Float_info` structure is determined as follows. The bytes of the value are first converted into an `int` constant *bits*. Then:

  - If *bits* is `0x7f800000`, the `float` value will be positive infinity.

  - If *bits* is `0xff800000`, the `float` value will be negative infinity.

  - If *bits* is in the range `0x7f800001` through `0x7fffffff` or in the range `0xff800001` through `0xffffffff`, the `float` value will be NaN.

  - In all other cases, let `s`, `e`, and `m` be 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 `float` value equals the result of the mathematical expression `s · m · 2^{e-150}`.
