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 numbernum2
- the second numberpublic static long zeroLowerBits(long bits, int nBits)
bits
- the bitstring to alterpublic static int getBit(long bits, int i)
bits
- the bitstring to extract fromi
- the bit to extractpublic void add(double num)
public double getCommon()
public String toString(long bits)
Copyright © 2022. All rights reserved.