diff --git a/src/java/org/apache/lucene/search/Similarity.java b/src/java/org/apache/lucene/search/Similarity.java index 459615f2943..2b522b5fd91 100644 --- a/src/java/org/apache/lucene/search/Similarity.java +++ b/src/java/org/apache/lucene/search/Similarity.java @@ -212,9 +212,9 @@ public abstract class Similarity { mantissa = 7; } - if (exponent < 1) { // underflow: use min value - exponent = 1; - mantissa = 0; + if (exponent < 0) { // underflow: use min value + exponent = 0; + mantissa = 1; } return (byte)((exponent << 3) | mantissa); // pack into a byte