From 0ee6dc5c6a6a4e57d22c3da770b53a875bb741f8 Mon Sep 17 00:00:00 2001 From: andri lim Date: Tue, 22 Oct 2019 20:54:36 +0700 Subject: [PATCH] convert runtime signed int mul to vm friendly --- stint/private/int_mul.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stint/private/int_mul.nim b/stint/private/int_mul.nim index 0b3149d..8f43d84 100644 --- a/stint/private/int_mul.nim +++ b/stint/private/int_mul.nim @@ -7,11 +7,11 @@ # # at your option. This file may not be copied, modified, or distributed except according to those terms. -import ./datatypes, ./uint_mul +import ./datatypes, ./uint_mul, ./compiletime_helpers func `*`*[T, T2](x, y: IntImpl[T, T2]): IntImpl[T, T2] {.inline.}= ## Multiplication for multi-precision signed integers # For 2-complement representation this is the exact same # as unsigned multiplication. We don't need to deal with the sign # TODO: overflow detection. - cast[type result](cast[UIntImpl[T2]](x) * cast[UIntImpl[T2]](y)) + convert[type result](convert[UIntImpl[T2]](x) * convert[UIntImpl[T2]](y))