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

    This is a Lucene.NET INTERNAL API, use at your own risk
    Inheritance
    System.Object
    SmallSingle
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public static class SmallSingle

    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 System.Single to a 32 bit System.Single.

    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
    [CLSCompliant(false)]
    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
    [CLSCompliant(false)]
    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 System.Single to a 32 bit System.Single.

    NOTE: This was byteToFloat() in Lucene

    Declaration
    [CLSCompliant(false)]
    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 System.Single to an 8 bit System.Single.

    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 System.Single to be converted to an 8 bit System.Single (System.Byte).

    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 System.Single to an 8 bit System.Single.

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

    The 32 bit System.Single to be converted to an 8 bit System.Single (System.SByte).

    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
    [CLSCompliant(false)]
    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
    [CLSCompliant(false)]
    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 © 2021 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.