Class CommonBits
Determines the maximum number of common most-significant bits in the mantissa of one or numbers. Can be used to compute the double-precision number which is represented by the common bits. If there are no common bits, the number computed is 0.0.
Inherited Members
Namespace: NetTopologySuite.Precision
Assembly: NetTopologySuite.dll
Syntax
public class CommonBits
Properties
| Improve this Doc View SourceCommon
Declaration
public double Common { get; }
Property Value
Type | Description |
---|---|
Double |
Methods
| Improve this Doc View SourceAdd(Double)
Declaration
public void Add(double num)
Parameters
Type | Name | Description |
---|---|---|
Double | num |
GetBit(Int64, Int32)
Extracts the i'th bit of a bitstring.
Declaration
public static int GetBit(long bits, int i)
Parameters
Type | Name | Description |
---|---|---|
Int64 | bits | The bitstring to extract from. |
Int32 | i | The bit to extract. |
Returns
Type | Description |
---|---|
Int32 | The value of the extracted bit. |
NumCommonMostSigMantissaBits(Int64, Int64)
This computes the number of common most-significant bits in the mantissas of two double-precision numbers. It does not count the hidden bit, which is always 1. It does not determine whether the numbers have the same exponent - if they do not, the value computed by this function is meaningless.
Declaration
public static int NumCommonMostSigMantissaBits(long num1, long num2)
Parameters
Type | Name | Description |
---|---|---|
Int64 | num1 | |
Int64 | num2 |
Returns
Type | Description |
---|---|
Int32 | The number of common most-significant mantissa bits. |
SignExpBits(Int64)
Computes the bit pattern for the sign and exponent of a double-precision number.
Declaration
public static long SignExpBits(long num)
Parameters
Type | Name | Description |
---|---|---|
Int64 | num |
Returns
Type | Description |
---|---|
Int64 | The bit pattern for the sign and exponent. |
ToString(Int64)
A representation of the Double bits formatted for easy readability
Declaration
public string ToString(long bits)
Parameters
Type | Name | Description |
---|---|---|
Int64 | bits |
Returns
Type | Description |
---|---|
String |
ZeroLowerBits(Int64, Int32)
Zeroes the lower n bits of a bitstring.
Declaration
public static long ZeroLowerBits(long bits, int nBits)
Parameters
Type | Name | Description |
---|---|---|
Int64 | bits | The bitstring to alter. |
Int32 | nBits | the number of bits to zero. |
Returns
Type | Description |
---|---|
Int64 | The zeroed bitstring. |