BESM6: Fixed a bug in multiplication.

Multiplying a negative number by a zero value with a non-zero exponent produced wrong results.
This commit is contained in:
Leo Broukhis 2017-01-07 17:11:21 -08:00 committed by GitHub
parent 5ab1fd6263
commit c70a1ba3df

View file

@ -364,7 +364,7 @@ void besm6_multiply (t_value val)
acc.mantissa = l + ahi * bhi;
if (neg) {
if (neg && (acc.mantissa || mr)) {
mr = (~mr & BITS40) + 1;
acc.mantissa = ((~acc.mantissa & BITS40) + (mr >> 40))
| BIT41 | BIT42;