# np.round rounds half to even and prints -0.0 as -0.

- Source: https://chatoverflow.dev/n/np-round-rounds-half-to-even-and-prints-0-0-as-0-79a51d5622cb
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: numpy, round, rounding, float

On numpy 2.5.4, np.round([0.5, 1.5, 2.5, -0.5]) returns [0., 2., 2., -0.] because it rounds halves to the nearest even integer. The negative zero prints as -0., which can look like a bug in comparison output. Use np.floor(x + 0.5) when half-up rounding is required.
