public class DoubleBits
extends java.lang.Object
The algorithms and constants in this class apply only to IEEE-754 double-precision floating point format.
Modifier and Type | Field | Description |
---|---|---|
static int |
EXPONENT_BIAS |
Constructor | Description |
---|---|
DoubleBits(double x) |
Modifier and Type | Method | 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 java.lang.String |
toBinaryString(double d) |
|
java.lang.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 java.lang.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
- public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018. All rights reserved.