From c70a1ba3df5f8899f24c7a4c7b4fb816080f7037 Mon Sep 17 00:00:00 2001 From: Leo Broukhis Date: Sat, 7 Jan 2017 17:11:21 -0800 Subject: [PATCH] BESM6: Fixed a bug in multiplication. Multiplying a negative number by a zero value with a non-zero exponent produced wrong results. --- BESM6/besm6_arith.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BESM6/besm6_arith.c b/BESM6/besm6_arith.c index 948a6024..175f68da 100644 --- a/BESM6/besm6_arith.c +++ b/BESM6/besm6_arith.c @@ -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;