From 14783559b1995735bbc1becc5f66c86f7f9a77d6 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar <151380951+kmr-srbh@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:56:45 +0530 Subject: [PATCH] Revert setting return type to `int` --- src/runtime/math.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/math.py b/src/runtime/math.py index a630c72a1b..4a3c457392 100644 --- a/src/runtime/math.py +++ b/src/runtime/math.py @@ -16,7 +16,7 @@ def modf(x: f64) -> tuple[f64, f64]: return (x - f64(int(x)), float(int(x))) -def factorial(n: i32) -> int: +def factorial(n: i32) -> i64: """Computes the factorial of `n`.""" MAX_LOOKUP_VALUE: i32 = 20 FACTORIAL_LOOKUP_TABLE: list[i64] = [ @@ -93,11 +93,11 @@ def factorial(n: i32) -> int: idx: i32 for idx in range(f_size - 1, -1, -1): result += str(f[idx]) - return int(result) + return i64(0) @overload -def factorial(n: i64) -> int: +def factorial(n: i64) -> i64: """Computes the factorial of `n`.""" MAX_LOOKUP_VALUE: i64 = i64(20) FACTORIAL_LOOKUP_TABLE: list[i64] = [ @@ -174,7 +174,7 @@ def factorial(n: i64) -> int: idx: i32 for idx in range(f_size - 1, -1, -1): result += str(f[idx]) - return int(result) + return i64(0) @overload