Show / Hide Table of Contents

    Class SmallSingle

    Floating point numbers smaller than 32 bits.

    NOTE: This was SmallFloat in Lucene

    This is a Lucene.NET INTERNAL API, use at your own risk
    Inheritance
    System.Object
    SmallSingle
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public class SmallSingle : object

    Methods

    | Improve this Doc View Source

    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
    System.Byte b
    Returns
    Type Description
    System.Single
    | Improve this Doc View Source

    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
    System.Byte b
    Returns
    Type Description
    System.Single
    | Improve this Doc View Source

    ByteToSingle(Byte, Int32, Int32)

    Converts an 8 bit to a 32 bit .

    NOTE: This was byteToFloat() in Lucene

    Declaration
    public static float ByteToSingle(byte b, int numMantissaBits, int zeroExp)
    Parameters
    Type Name Description
    System.Byte b
    System.Int32 numMantissaBits
    System.Int32 zeroExp
    Returns
    Type Description
    System.Single
    | Improve this Doc View Source

    SByte315ToSingle(SByte)

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

    NOTE: This was byte315ToFloat() in Lucene

    Declaration
    public static float SByte315ToSingle(sbyte b)
    Parameters
    Type Name Description
    System.SByte b
    Returns
    Type Description
    System.Single
    | Improve this Doc View Source

    SByte52ToSingle(SByte)

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

    NOTE: This was byte52ToFloat() in Lucene

    Declaration
    public static float SByte52ToSingle(sbyte b)
    Parameters
    Type Name Description
    System.SByte b
    Returns
    Type Description
    System.Single
    | Improve this Doc View Source

    SByteToSingle(SByte, Int32, Int32)

    Converts an 8 bit to a 32 bit .

    NOTE: This was byteToFloat() in Lucene

    Declaration
    public static float SByteToSingle(sbyte b, int numMantissaBits, int zeroExp)
    Parameters
    Type Name Description
    System.SByte b
    System.Int32 numMantissaBits
    System.Int32 zeroExp
    Returns
    Type Description
    System.Single
    | Improve this Doc View Source

    SingleToByte(Single, Int32, Int32)

    Converts a 32 bit to an 8 bit .

    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
    System.Single f

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

    System.Int32 numMantissaBits

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

    System.Int32 zeroExp

    The zero-point in the range of exponent values.

    Returns
    Type Description
    System.Byte

    The 8 bit float representation.

    | Improve this Doc View Source

    SingleToByte315(Single)

    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
    System.Single f
    Returns
    Type Description
    System.Byte
    | Improve this Doc View Source

    SingleToByte52(Single)

    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
    System.Single f
    Returns
    Type Description
    System.Byte
    | Improve this Doc View Source

    SingleToSByte(Single, Int32, Int32)

    Converts a 32 bit to an 8 bit .

    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
    public static sbyte SingleToSByte(float f, int numMantissaBits, int zeroExp)
    Parameters
    Type Name Description
    System.Single f

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

    System.Int32 numMantissaBits

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

    System.Int32 zeroExp

    The zero-point in the range of exponent values.

    Returns
    Type Description
    System.SByte

    The 8 bit float representation.

    | Improve this Doc View Source

    SingleToSByte315(Single)

    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
    public static sbyte SingleToSByte315(float f)
    Parameters
    Type Name Description
    System.Single f
    Returns
    Type Description
    System.SByte
    | Improve this Doc View Source

    SingleToSByte52(Single)

    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
    public static sbyte SingleToSByte52(float f)
    Parameters
    Type Name Description
    System.Single f
    Returns
    Type Description
    System.SByte
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)