Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SmallSingle

    Floating point numbers smaller than 32 bits.

    NOTE: This was SmallFloat in Lucene

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Inheritance
    object
    SmallSingle
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public static class SmallSingle

    Methods

    Byte315ToSingle(byte)

    ByteToSingle(b, mantissaBits=3, zeroExponent=15)

    NOTE: This was byte315ToFloat() in Lucene
    Declaration
    public static float Byte315ToSingle(byte b)
    Parameters
    Type Name Description
    byte b
    Returns
    Type Description
    float

    Byte52ToSingle(byte)

    ByteToFloat(b, mantissaBits=5, zeroExponent=2)

    NOTE: This was byte52ToFloat() in Lucene
    Declaration
    public static float Byte52ToSingle(byte b)
    Parameters
    Type Name Description
    byte b
    Returns
    Type Description
    float

    ByteToSingle(byte, int, int)

    Converts an 8 bit float to a 32 bit float.

    NOTE: This was byteToFloat() in Lucene
    Declaration
    public static float ByteToSingle(byte b, int numMantissaBits, int zeroExp)
    Parameters
    Type Name Description
    byte b
    int numMantissaBits
    int zeroExp
    Returns
    Type Description
    float

    SByte315ToSingle(sbyte)

    SByteToSingle(b, mantissaBits=3, zeroExponent=15)

    NOTE: This was byte315ToFloat() in Lucene
    Declaration
    [CLSCompliant(false)]
    public static float SByte315ToSingle(sbyte b)
    Parameters
    Type Name Description
    sbyte b
    Returns
    Type Description
    float

    SByte52ToSingle(sbyte)

    SByteToFloat(b, mantissaBits=5, zeroExponent=2)

    NOTE: This was byte52ToFloat() in Lucene
    Declaration
    [CLSCompliant(false)]
    public static float SByte52ToSingle(sbyte b)
    Parameters
    Type Name Description
    sbyte b
    Returns
    Type Description
    float

    SByteToSingle(sbyte, int, int)

    Converts an 8 bit float to a 32 bit float.

    NOTE: This was byteToFloat() in Lucene
    Declaration
    [CLSCompliant(false)]
    public static float SByteToSingle(sbyte b, int numMantissaBits, int zeroExp)
    Parameters
    Type Name Description
    sbyte b
    int numMantissaBits
    int zeroExp
    Returns
    Type Description
    float

    SingleToByte(float, int, int)

    Converts a 32 bit float to an 8 bit float.

    Values less than zero are all mapped to zero.

    Values are truncated (rounded down) to the nearest 8 bit value.

    Values between zero and the smallest representable value are rounded up.
    Declaration
    public static byte SingleToByte(float f, int numMantissaBits, int zeroExp)
    Parameters
    Type Name Description
    float f

    The 32 bit float to be converted to an 8 bit float (byte).

    int numMantissaBits

    The number of mantissa bits to use in the byte, with the remainder to be used in the exponent.

    int zeroExp

    The zero-point in the range of exponent values.

    Returns
    Type Description
    byte

    The 8 bit float representation.

    SingleToByte315(float)

    SingleToSByte((byte)b, mantissaBits=3, zeroExponent=15)

    smallest non-zero value = 5.820766E-10

    largest value = 7.5161928E9

    epsilon = 0.125

    NOTE: This was floatToByte315() in Lucene
    Declaration
    public static byte SingleToByte315(float f)
    Parameters
    Type Name Description
    float f
    Returns
    Type Description
    byte

    SingleToByte52(float)

    SingleToByte(b, mantissaBits=5, zeroExponent=2)

    smallest nonzero value = 0.033203125

    largest value = 1984.0

    epsilon = 0.03125

    NOTE: This was floatToByte52() in Lucene
    Declaration
    public static byte SingleToByte52(float f)
    Parameters
    Type Name Description
    float f
    Returns
    Type Description
    byte

    SingleToSByte(float, int, int)

    Converts a 32 bit float to an 8 bit float.

    Values less than zero are all mapped to zero.

    Values are truncated (rounded down) to the nearest 8 bit value.

    Values between zero and the smallest representable value are rounded up.

    NOTE: This was floatToByte() in Lucene
    Declaration
    [CLSCompliant(false)]
    public static sbyte SingleToSByte(float f, int numMantissaBits, int zeroExp)
    Parameters
    Type Name Description
    float f

    The 32 bit float to be converted to an 8 bit float (sbyte).

    int numMantissaBits

    The number of mantissa bits to use in the byte, with the remainder to be used in the exponent.

    int zeroExp

    The zero-point in the range of exponent values.

    Returns
    Type Description
    sbyte

    The 8 bit float representation.

    SingleToSByte315(float)

    SingleToSByte(b, mantissaBits=3, zeroExponent=15)

    smallest non-zero value = 5.820766E-10

    largest value = 7.5161928E9

    epsilon = 0.125

    NOTE: This was floatToByte315() in Lucene
    Declaration
    [CLSCompliant(false)]
    public static sbyte SingleToSByte315(float f)
    Parameters
    Type Name Description
    float f
    Returns
    Type Description
    sbyte

    SingleToSByte52(float)

    SingleToSByte(b, mantissaBits=5, zeroExponent=2)

    smallest nonzero value = 0.033203125

    largest value = 1984.0

    epsilon = 0.03125

    NOTE: This was floatToByte52() in Lucene
    Declaration
    [CLSCompliant(false)]
    public static sbyte SingleToSByte52(float f)
    Parameters
    Type Name Description
    float f
    Returns
    Type Description
    sbyte
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.