From f4272e33f9cec5563cc23123a07784eb48ed5ba5 Mon Sep 17 00:00:00 2001 From: Ermal Kaleci <ermalkaleci@gmail.com> Date: Sat, 21 Mar 2020 00:06:33 +0100 Subject: [PATCH] replace div to mul by signum (#127) --- utilities/src/fixed_128.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/src/fixed_128.rs b/utilities/src/fixed_128.rs index 01feec9..769f23f 100644 --- a/utilities/src/fixed_128.rs +++ b/utilities/src/fixed_128.rs @@ -110,7 +110,7 @@ impl Fixed128 { .checked_mul(U256::from(DIV)) .and_then(|n| n.checked_div(U256::from(rhs))) .and_then(|n| TryInto::<i128>::try_into(n).ok()) - .map(|n| Self(n / signum)) + .map(|n| Self(n * signum)) } /// Checked mul for int type `N`. -- GitLab