From b1b55e907a5aaf177344769d2b303351ba936bff Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 13 Jan 2022 09:39:00 +0000 Subject: Print multi dimensional arrays correctly. The axis were in the wrong order before --- print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'print.c') diff --git a/print.c b/print.c index 1d0856d..409de45 100644 --- a/print.c +++ b/print.c @@ -76,7 +76,7 @@ pparray(Array *a) int j = 1; int spaceprinted = 0; for(int dim = 0; dim < a->rank && i+1 != a->size; dim++){ - j *= a->shape[dim]; + j *= a->shape[a->rank-dim-1]; tmp = res; if((i+1)%j == 0){ spaceprinted = 1; -- cgit v1.2.3