mutate array in-place to multiply by a scalar value