public class DoubleBits extends Object
The algorithms and constants in this class apply only to IEEE-754 double-precision floating point format.
| Modifier and Type | Field and Description |
|---|---|
static int |
EXPONENT_BIAS |
| Constructor and Description |
|---|
DoubleBits(double x) |
| Modifier and Type | Method and Description |
|---|---|
int |
biasedExponent()
Determines the exponent for the number
|
static int |
exponent(double d) |
int |
getBit(int i) |
double |
getDouble() |
int |
getExponent()
Determines the exponent for the number
|
static double |
maximumCommonMantissa(double d1,
double d2) |
int |
numCommonMantissaBits(DoubleBits db)
This computes the number of common most-significant bits in the mantissa.
|
static double |
powerOf2(int exp) |
static String |
toBinaryString(double d) |
String |
toString()
A representation of the Double bits formatted for easy readability
|
static double |
truncateToPowerOfTwo(double d) |
void |
zeroLowerBits(int nBits) |
public static final int EXPONENT_BIAS
public static int exponent(double d)
public static double maximumCommonMantissa(double d1,
double d2)
public static double powerOf2(int exp)
public static String toBinaryString(double d)
public static double truncateToPowerOfTwo(double d)
public int biasedExponent()
public int getBit(int i)
public double getDouble()
public int getExponent()
public int numCommonMantissaBits(DoubleBits db)
db - public String toString()
public void zeroLowerBits(int nBits)
Copyright © 2015 Revolution Systems Inc.. All rights reserved.