If `T` is `Real`, then `typeof(z)` will be `Int`, and then you will get errors if there are non-integer values in the array.

On the other hand, if `T` is `Int8`, then `z` will have type `Int`, and I think we want `Tr` to be `Int` too.