|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vividsolutions.jts.index.quadtree.DoubleBits
DoubleBits manipulates Double numbers by using bit manipulation and bit-field extraction. For some operations (such as determining the exponent) this is more accurate than using mathematical operations (which suffer from round-off error).
The algorithms and constants in this class apply only to IEEE-754 double-precision floating point format.
Field Summary | |
static int |
EXPONENT_BIAS
|
Constructor Summary | |
DoubleBits(double x)
|
Method Summary | |
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int EXPONENT_BIAS
Constructor Detail |
public DoubleBits(double x)
Method Detail |
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |