[
https://issues.apache.org/jira/browse/LUCENE-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998439#comment-12998439
]
Yonik Seeley commented on LUCENE-2937:
--------------------------------------
1.9 is the earliest "affects" version we have in JIRA, but this underflow
detection issue goes all the way back to the original floatToByte code added in
v1.3
The problem is that the code only checked for underflow by checking the
exponent:
{code}
if (exponent < 0) { // underflow: use min value
exponent = 0;
mantissa = 1;
}
{code}
But it's also underflow if the exponent is 0 and the mantissa bits are also 0.
So for the old code, this should be:
{code}
if (exponent < 0 || exponent == 0 && mantissa == 0) { // underflow: use
min value
exponent = 0;
mantissa = 1;
}
{code}
Now the trick is to find the most efficient way to make an equivalent fix
SmallFloat
> small float underflow detection bug
> -----------------------------------
>
> Key: LUCENE-2937
> URL: https://issues.apache.org/jira/browse/LUCENE-2937
> Project: Lucene - Java
> Issue Type: Bug
> Affects Versions: 1.9
> Reporter: Yonik Seeley
> Priority: Minor
>
> Underflow detection in small floats has a bug, and can incorrectly result in
> a byte value of 0 for a non-zero float.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]