public class CommonBits extends Object
| Constructor and Description |
|---|
CommonBits()
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double num)
|
static int |
getBit(long bits, int i)
Extracts the i'th bit of a bitstring.
|
double |
getCommon()
|
static int |
numCommonMostSigMantissaBits(long num1, long num2)
This computes the number of common most-significant bits in the mantissas of two double-precision numbers.
|
static long |
signExpBits(long num)
Computes the bit pattern for the sign and exponent of a double-precision number.
|
String |
toString(long bits)
A representation of the Double bits formatted for easy readability
|
static long |
zeroLowerBits(long bits, int nBits)
Zeroes the lower n bits of a bitstring.
|
public static long signExpBits(long num)
num -
public static int numCommonMostSigMantissaBits(long num1,
long num2)
num1 - the first number
num2 - the second number
public static long zeroLowerBits(long bits,
int nBits)
bits - the bitstring to alter
public static int getBit(long bits,
int i)
bits - the bitstring to extract from
i - the bit to extract
public void add(double num)
public double getCommon()
public StringtoString(long bits)