Round up from .5

前端 未结 7 728
一个人的身影
一个人的身影 2020-11-22 11:41

Yes I know why we always round to the nearest even number if we are in the exact middle (i.e. 2.5 becomes 2) of two numbers. But when I want to evaluate data for some peopl

相关标签:
7条回答
  • 2020-11-22 12:15

    Depending on how comfortable you are with jiggling your data, this works:

    round(x+10*.Machine$double.eps)
    # [1]  1  2  3  4  5  6  7  8  9 10
    
    0 讨论(0)
提交回复
热议问题