|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.SmallFloat
public class SmallFloat
Floating point numbers smaller than 32 bits.
Constructor Summary | |
---|---|
SmallFloat()
|
Method Summary | |
---|---|
static float |
byte315ToFloat(byte b)
byteToFloat(b, mantissaBits=3, zeroExponent=15) |
static float |
byte52ToFloat(byte b)
byteToFloat(b, mantissaBits=5, zeroExponent=2) |
static float |
byteToFloat(byte b,
int numMantissaBits,
int zeroExp)
Converts an 8 bit float to a 32 bit float. |
static byte |
floatToByte(float f,
int numMantissaBits,
int zeroExp)
Converts a 32 bit float to an 8 bit float. |
static byte |
floatToByte315(float f)
floatToByte(b, mantissaBits=3, zeroExponent=15) smallest non-zero value = 5.820766E-10 largest value = 7.5161928E9 epsilon = 0.125 |
static byte |
floatToByte52(float f)
floatToByte(b, mantissaBits=5, zeroExponent=2) smallest nonzero value = 0.033203125 largest value = 1984.0 epsilon = 0.03125 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SmallFloat()
Method Detail |
---|
public static byte floatToByte(float f, int numMantissaBits, int zeroExp)
f
- the 32 bit float to be converted to an 8 bit float (byte)numMantissaBits
- the number of mantissa bits to use in the byte, with the remainder to be used in the exponentzeroExp
- the zero-point in the range of exponent values
public static float byteToFloat(byte b, int numMantissaBits, int zeroExp)
public static byte floatToByte315(float f)
public static float byte315ToFloat(byte b)
public static byte floatToByte52(float f)
public static float byte52ToFloat(byte b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |