## Why is this an issue?

`Double.longBitsToDouble` converts the bit pattern into its corresponding floating-point representation. The method expects a 64-bit long argument to interpret the bits as a double value correctly.

When the argument is a smaller data type, the cast to `long` may lead to a different value than expected due to the interpretation of the most significant bit, which, in turn, results in `Double.longBitsToDouble` returning an incorrect value.

### Noncompliant code example

    int i = 0x80003800;
    Double.longBitsToDouble(i);   // Noncompliant - NaN

### Compliant solution

    long i = 0x80003800L;
    Double.longBitsToDouble(i);   // Compliant - 1.0610049784E-314

## Resources

### Documentation

- Oracle Java SE - Double.doubleToLongBits

### Articles & blog posts

- Wikipedia - Double Precision floating point format
- Wikipedia - Single Precision floating point format