diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2026-01-16 19:16:58 +0100 |
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2026-01-16 19:16:58 +0100 |
| commit | 67eea51eb3cc205c2884de613f1102655276b191 (patch) | |
| tree | b20025de05de70a721bb70911545ac3cf64196bf /cbits/arith.c | |
| parent | b6d52a08e9718b6131ff4596215fbe902499c277 (diff) | |
| parent | 0216dacb82f305e30f147ec7242dcd8599da721a (diff) | |
Merge branch 'master' into mvecsReplicate
Diffstat (limited to 'cbits/arith.c')
| -rw-r--r-- | cbits/arith.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cbits/arith.c b/cbits/arith.c index 1066463..ee248a4 100644 --- a/cbits/arith.c +++ b/cbits/arith.c @@ -494,7 +494,9 @@ static void print_shape(FILE *stream, i64 rank, const i64 *shape) { if (rank == 0) return arr[0]; \ typ result = 0; \ TARRAY_WALK_NOINNER(again, rank, shape, strides, { \ - REDUCE_BODY_CODE(op, typ, shape[rank - 1], strides[rank - 1], arr, arrlinidx, result); \ + typ dest = 0; \ + REDUCE_BODY_CODE(op, typ, shape[rank - 1], strides[rank - 1], arr, arrlinidx, dest); \ + result = result op dest; \ }); \ return result; \ } |
