diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2023-12-28 16:57:48 +1300 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2023-12-28 17:00:05 +1300 |
commit | 382eff571a650f1e89f6d4b39e0162a9d089bb97 (patch) | |
tree | 3c76c7149b268de10b8a1b219bdb8e5e10f957e7 /src/devices/math.rs | |
parent | 77067f6e244a9cf4a6ef59df2e3d735b4f172c35 (diff) | |
download | bedrock-pc-382eff571a650f1e89f6d4b39e0162a9d089bb97.zip |
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.
Diffstat (limited to 'src/devices/math.rs')
-rw-r--r-- | src/devices/math.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |