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
| Edit this page View SourceCommon
Declaration
public double Common { get; }
Property Value
| Type | Description |
|---|---|
| double |
Methods
| Edit this page View SourceAdd(double)
Declaration
public void Add(double num)
Parameters
| Type | Name | Description |
|---|---|---|
| double | num |
GetBit(long, int)
Extracts the i'th bit of a bitstring.
Declaration
public static int GetBit(long bits, int i)
Parameters
| Type | Name | Description |
|---|---|---|
| long | bits | The bitstring to extract from. |
| int | i | The bit to extract. |
Returns
| Type | Description |
|---|---|
| int | The value of the extracted bit. |
NumCommonMostSigMantissaBits(long, long)
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 |
|---|---|---|
| long | num1 | |
| long | num2 |
Returns
| Type | Description |
|---|---|
| int | The number of common most-significant mantissa bits. |
SignExpBits(long)
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 |
|---|---|---|
| long | num |
Returns
| Type | Description |
|---|---|
| long | The bit pattern for the sign and exponent. |
ToString(long)
A representation of the Double bits formatted for easy readability
Declaration
public string ToString(long bits)
Parameters
| Type | Name | Description |
|---|---|---|
| long | bits |
Returns
| Type | Description |
|---|---|
| string |
ZeroLowerBits(long, int)
Zeroes the lower n bits of a bitstring.
Declaration
public static long ZeroLowerBits(long bits, int nBits)
Parameters
| Type | Name | Description |
|---|---|---|
| long | bits | The bitstring to alter. |
| int | nBits | the number of bits to zero. |
Returns
| Type | Description |
|---|---|
| long | The zeroed bitstring. |