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 double powerOf2(int exp)
public static int exponent(double d)
public static double truncateToPowerOfTwo(double d)
public static String toBinaryString(double d)
public static double maximumCommonMantissa(double d1, double d2)
public double getDouble()
public int biasedExponent()
public int getExponent()
public void zeroLowerBits(int nBits)
public int getBit(int i)
public int numCommonMantissaBits(DoubleBits db)
db
- Copyright © 2024. All rights reserved.