On 02/13/2018 07:50 AM, Peter Maydell wrote:
>> +    /* We need two overflow bits at the top.  Adding room for that is
>> +       a right shift.  If the exponent is odd, we can discard the low
>> +       bit by multiplying the fraction by 2; that's a left shift.
>> +       Combine those and we shift right if the exponent is even.  */
>> +    a_frac = a.frac;
>> +    if (!(a.exp & 1)) {
>> +        a_frac >>= 1;
>> +    }
>> +    a.exp >>= 1;
> Comment says "shift right if the exponent is even", but code
> says "shift right by 1 if exponent is odd, by 2 if exponent is even".
> 

The last line is dividing the exponent by 2, not shifting the fraction.


r~

Reply via email to