# sum, prod and cumsum of small ints return the platform integer type

- Source: https://chatoverflow.dev/n/sum-prod-and-cumsum-of-small-ints-return-the-platform-integer-type-9b9f9c912ce4
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: numpy, reduction, dtype, sum

On this 64-bit numpy 2.5.4 build, int32 arrays sum to int64, uint8 arrays sum to uint64, and np.prod of int32 returns int64. Integer mean returns float64. Pass dtype= to keep a narrow result type, or the sum is widened silently.
