From 382eff571a650f1e89f6d4b39e0162a9d089bb97 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Thu, 28 Dec 2023 16:57:48 +1300 Subject: Fix multiplication error in math device The order of the two result values from the widening multiply operation in Rust was reversed, leading to incorrect multiplication results when using the math device. --- src/devices/math.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/devices/math.rs') diff --git a/src/devices/math.rs b/src/devices/math.rs index 6260529..c8d2194 100644 --- a/src/devices/math.rs +++ b/src/devices/math.rs @@ -20,7 +20,7 @@ impl MathDevice { } pub fn multiply(&mut self) { - let (high, low) = self.operand_1.widening_mul(self.operand_2); + let (low, high) = self.operand_1.widening_mul(self.operand_2); self.product_high = high; self.product_low = low; } -- cgit v1.2.3-70-g09d2