Skip to content

Commit 646f108

Browse files
authored
Fix indexing bug (#30)
1 parent 79738c1 commit 646f108

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spec/API_specification/broadcasting.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ The results of the element-wise operation must be stored in an array having a sh
3636

3737
1. Repeat, while `i >= 0`
3838

39-
1. If `N1-N+i >= 0`, let `d1` be the size of dimension `n` for array `A` (i.e., the result of `shape1[i]`); else, let `d1` be `1`.
39+
1. Let `n1` be `N1 - N + i`.
4040

41-
1. If `N2-N+i >= 0`, let `d2` be the size of dimension `n` for array `B` (i.e., the result of `shape2[i]`); else, let `d2` be `1`.
41+
1. If `n1 >= 0`, let `d1` be the size of dimension `n1` for array `A` (i.e., the result of `shape1[n1]`); else, let `d1` be `1`.
42+
43+
1. Let `n2` be `N2 - N + i`.
44+
45+
1. If `n2 >= 0`, let `d2` be the size of dimension `n2` for array `B` (i.e., the result of `shape2[n2]`); else, let `d2` be `1`.
4246

4347
1. If `d1 == 1`, then
4448

0 commit comments

Comments
 (0)