Browse Source

Merge pull request #1374 from indiscible/fix-mathprod

fix math.prod
gingerBill 3 years ago
parent
commit
aba6d2e52c
1 changed files with 1 additions and 0 deletions
  1. 1 0
      core/math/math.odin

+ 1 - 0
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
 	}