How this calculator works
The neighbouring multiples of ten define the interval containing the input. For a positive whole number, the units digit identifies the nearest ten: below five favours the lower ten, above five favours the upper ten. Exactly five is a tie. Decimal digits and negative values are handled by exact integer arithmetic. The distance table makes the choice explicit even when the input lies below zero.
Formula
Candidates are 10 × floor(x/10) and the next multiple of 10. Compare their distances to x. At a tie, apply the selected rule. Exact multiples return themselves.
Worked example
145 is halfway between 140 and 150. Half-up gives 150, while half-even gives 140 because 14 is even. For -145, half-up gives -150 and half-even gives -140.
Advertisement
Frequently asked questions
Does half-even check the last digit of the answer?
It checks the integer multiple of 10. The lower candidate 140 is 14 times 10, an even multiple, so it wins the example tie.
What is the difference between up and ceiling?
Up moves away from zero. Ceiling moves toward plus infinity. They agree for positive inputs and can disagree for negative inputs.
Can I enter a very long integer?
Yes. Up to 200 characters of plain decimal text are retained exactly. Omit commas, spaces within the number and scientific notation.