From 4ebdb6740ef041f4b600663b3b597e882c3fc42d Mon Sep 17 00:00:00 2001 From: gilles Date: Thu, 16 Dec 2021 18:20:10 +0100 Subject: [PATCH] fix math.prod accumulator was not initialized to one --- core/math/math.odin | 1 + 1 file changed, 1 insertion(+) diff --git a/core/math/math.odin b/core/math/math.odin index caaa6f51b..b81598da9 100644 --- a/core/math/math.odin +++ b/core/math/math.odin @@ -1196,6 +1196,7 @@ sum :: proc "contextless" (x: $T/[]$E) -> (res: E) prod :: proc "contextless" (x: $T/[]$E) -> (res: E) where intrinsics.type_is_numeric(E) { + res = 1 for i in x { res *= i }