public static long unpackGetExponentUnbiased(
    final double d)
  {
    final long b = Double.doubleToRawLongBits(d);
    final long em = b & Binary64.MASK_EXPONENT;
    final long es = em >> 52;
    return es - Binary64.BIAS;
  }
public static long unpackGetExponentUnbiased ( final double d ) { final long b = Double . doubleToRawLongBits ( d ) ; final long em = b & Binary64 . MASK_EXPONENT ; final long es = em > > 52 ; return es - Binary64 . BIAS ; }
<p>
Extract and unbias the exponent of the given packed {@code double}
value.
</p>
<p>
The exponent is encoded <i>biased</i> as a number in the range
{@code [0, 2047]}, with {@code 0} indicating that the number is
<i>subnormal</i> and {@code [1, 2046]} denoting the actual exponent
plus {@link #BIAS}. Infinite and {@code NaN} values always have a
biased exponent of {@code 2047}.
</p>
<p>
This function will therefore return:
</p>
<ul>
<li>
<code>0 - {@link #BIAS} = -1023</code> iff the input is a
<i>subnormal</i> number.</li>
<li>An integer in the range
<code>[1 - {@link #BIAS}, 2046 - {@link #BIAS}] = [-1022, 1023]</code>
iff the input is a <i>normal</i> number.</li>
<li>
<code>2047 - {@link #BIAS} = 1024</code> iff the input is
{@link Double#POSITIVE_INFINITY}, {@link Double#NEGATIVE_INFINITY}, or
{@code NaN}.</li>
</ul>

@param d A floating point value

@return An unbiased exponent