aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/fp_math.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/fp_math.py')
-rw-r--r--ethosu/vela/fp_math.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethosu/vela/fp_math.py b/ethosu/vela/fp_math.py
index 66375611..5228f031 100644
--- a/ethosu/vela/fp_math.py
+++ b/ethosu/vela/fp_math.py
@@ -41,7 +41,7 @@ def saturating_rounding_mul(a, b):
if a == b and a == np.iinfo(np.int32).min:
return np.int32(np.iinfo(np.int32).max)
divider = 1 << 31
- ab = a * b
+ ab = np.int64(a) * np.int64(b)
if ab >= 0:
nudge = 1 << 30
return (ab + nudge) // divider