Rounds towards nearest neighbour. If equidistant, rounds away from zero.
And ROUND_HALF_CEIL like this:
Rounds towards nearest neighbour. If equidistant, rounds towards Infinity.
I just don't see what is the difference between "away from zero" and "towards Infinity"? Using either rounding mode seems to produce the same outputs, at least for the inputs that I have used.
In what cases would the outputs diverge between these two different rounding modes?
The docs define
ROUND_HALF_UP
like this:And
ROUND_HALF_CEIL
like this:I just don't see what is the difference between "away from zero" and "towards Infinity"? Using either rounding mode seems to produce the same outputs, at least for the inputs that I have used.
In what cases would the outputs diverge between these two different rounding modes?