Explorar o código

Merge pull request #1374 from indiscible/fix-mathprod

fix math.prod
gingerBill %!s(int64=3) %!d(string=hai) anos
pai
achega
aba6d2e52c
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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
 	}