mirror of https://github.com/apache/lucene.git
Fixed a bug in floatToByte().
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149938 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e8a9993725
commit
31ec31b325
|
@ -212,9 +212,9 @@ public abstract class Similarity {
|
||||||
mantissa = 7;
|
mantissa = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exponent < 1) { // underflow: use min value
|
if (exponent < 0) { // underflow: use min value
|
||||||
exponent = 1;
|
exponent = 0;
|
||||||
mantissa = 0;
|
mantissa = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (byte)((exponent << 3) | mantissa); // pack into a byte
|
return (byte)((exponent << 3) | mantissa); // pack into a byte
|
||||||
|
|
Loading…
Reference in New Issue