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
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public static class SmallSingle
Methods
| Improve this Doc View SourceByte315ToSingle(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 |
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 |
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 |
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 |
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 |
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 |
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. |
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 |
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 |
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. |
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 |
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 |