There is a bug here. Please make out array not `a` (maybe even has a different type). When decimals=0 it seems to short cut and does nothing, but even then it must copy the data into out if given (the normal copy function will optimize it away if it is the same array).