fix math.prod

accumulator was not initialized to one
This commit is contained in:
gilles committed 2021-12-16 18:55:51 +01:00
1 parent 4423bc0706
commit 4ebdb6740e
1 file changed
+1
+1
View File
@@ -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
}