0

round(c(0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5))

Output: 0 2 2 4 4 6 6

I do not see a problem, when X.5 rounds to X or to X+1 (I could accept that as a matter of definition). I can not understand when X.5 rounds to X+1 but some Y.5 rounds to Y. For example, round(1.5)=round(2.5)=2 ?! Thanks a lot for your help in understaning!

ML Lover
  • 1
  • 1
  • 5
    This is documented on the help page `?round`. The relevant part is `Note that for rounding off a 5, the IEC 60559 standard is expected to be used, ‘go to the even digit’.` See also [previous answer](https://stackoverflow.com/a/39913257/4752675) – G5W May 05 '18 at 20:43
  • Thanks a lot for the answer! Interesting way of rounding :/ ... – ML Lover May 05 '18 at 21:59

0 Answers0