Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Static Public Member Functions | List of all members
Lucene.Net.Util.SmallFloat Class Reference

Floating point numbers smaller than 32 bits. More...

Static Public Member Functions

static sbyte FloatToByte (float f, int numMantissaBits, int zeroExp)
 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.
 
static float ByteToFloat (byte b, int numMantissaBits, int zeroExp)
 Converts an 8 bit float to a 32 bit float.
 
static sbyte FloatToByte315 (float f)
 floatToByte(b, mantissaBits=3, zeroExponent=15)
smallest non-zero value = 5.820766E-10
largest value = 7.5161928E9
epsilon = 0.125
 
static float Byte315ToFloat (byte b)
 byteToFloat(b, mantissaBits=3, zeroExponent=15)
 
static sbyte FloatToByte52 (float f)
 floatToByte(b, mantissaBits=5, zeroExponent=2)
smallest nonzero value = 0.033203125
largest value = 1984.0
epsilon = 0.03125
 
static float Byte52ToFloat (byte b)
 byteToFloat(b, mantissaBits=5, zeroExponent=2)
 

Detailed Description

Floating point numbers smaller than 32 bits.

<version> $Id$ </version>

Definition at line 29 of file SmallFloat.cs.

Member Function Documentation

static float Lucene.Net.Util.SmallFloat.Byte315ToFloat ( byte  b)
static

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

Definition at line 108 of file SmallFloat.cs.

static float Lucene.Net.Util.SmallFloat.Byte52ToFloat ( byte  b)
static

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

Definition at line 141 of file SmallFloat.cs.

static float Lucene.Net.Util.SmallFloat.ByteToFloat ( byte  b,
int  numMantissaBits,
int  zeroExp 
)
static

Converts an 8 bit float to a 32 bit float.

Definition at line 69 of file SmallFloat.cs.

static sbyte Lucene.Net.Util.SmallFloat.FloatToByte ( float  f,
int  numMantissaBits,
int  zeroExp 
)
static

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.

Parameters
fthe 32 bit float to be converted to an 8 bit float (byte)
numMantissaBitsthe number of mantissa bits to use in the byte, with the remainder to be used in the exponent
zeroExpthe zero-point in the range of exponent values
Returns
the 8 bit float representation

Definition at line 47 of file SmallFloat.cs.

static sbyte Lucene.Net.Util.SmallFloat.FloatToByte315 ( float  f)
static

floatToByte(b, mantissaBits=3, zeroExponent=15)
smallest non-zero value = 5.820766E-10
largest value = 7.5161928E9
epsilon = 0.125

Definition at line 92 of file SmallFloat.cs.

static sbyte Lucene.Net.Util.SmallFloat.FloatToByte52 ( float  f)
static

floatToByte(b, mantissaBits=5, zeroExponent=2)
smallest nonzero value = 0.033203125
largest value = 1984.0
epsilon = 0.03125

Definition at line 125 of file SmallFloat.cs.


The documentation for this class was generated from the following file: