Search Results for

    Show / Hide Table of Contents

    Class 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.

    Inheritance
    object
    DoubleBits
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Index.Quadtree
    Assembly: NetTopologySuite.dll
    Syntax
    public class DoubleBits

    Constructors

    | Edit this page View Source

    DoubleBits(double)

    Declaration
    public DoubleBits(double x)
    Parameters
    Type Name Description
    double x

    Fields

    | Edit this page View Source

    ExponentBias

    Declaration
    public const int ExponentBias = 1023
    Field Value
    Type Description
    int

    Properties

    | Edit this page View Source

    BiasedExponent

    Determines the exponent for the number.

    Declaration
    public int BiasedExponent { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Double

    Declaration
    public double Double { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    Exponent

    Determines the exponent for the number.

    Declaration
    public int Exponent { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    GetBit(int)

    Declaration
    public int GetBit(int i)
    Parameters
    Type Name Description
    int i
    Returns
    Type Description
    int
    | Edit this page View Source

    GetExponent(double)

    Declaration
    public static int GetExponent(double d)
    Parameters
    Type Name Description
    double d
    Returns
    Type Description
    int
    | Edit this page View Source

    MaximumCommonMantissa(double, double)

    Declaration
    public static double MaximumCommonMantissa(double d1, double d2)
    Parameters
    Type Name Description
    double d1
    double d2
    Returns
    Type Description
    double
    | Edit this page View Source

    NumCommonMantissaBits(DoubleBits)

    This computes the number of common most-significant bits in the mantissa. 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 int NumCommonMantissaBits(DoubleBits db)
    Parameters
    Type Name Description
    DoubleBits db
    Returns
    Type Description
    int

    The number of common most-significant mantissa bits.

    | Edit this page View Source

    PowerOf2(int)

    Declaration
    public static double PowerOf2(int exp)
    Parameters
    Type Name Description
    int exp
    Returns
    Type Description
    double
    | Edit this page View Source

    ToBinaryString(double)

    Declaration
    public static string ToBinaryString(double d)
    Parameters
    Type Name Description
    double d
    Returns
    Type Description
    string
    | Edit this page View Source

    ToString()

    A representation of the Double bits formatted for easy readability.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    | Edit this page View Source

    TruncateToPowerOfTwo(double)

    Declaration
    public static double TruncateToPowerOfTwo(double d)
    Parameters
    Type Name Description
    double d
    Returns
    Type Description
    double
    | Edit this page View Source

    ZeroLowerBits(int)

    Declaration
    public void ZeroLowerBits(int nBits)
    Parameters
    Type Name Description
    int nBits
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX