Skip to content
Back to formatted view

Raw Message

Message-ID: <CA+dpOJ=NQDrUtzABGbfhPabO9kwrpMZp4xSQxG-3AjmS7eoozA@mail.gmail.com>
Date: 2013-01-03T17:44:42Z
From: Christofer Bogaso
Subject: Question on Round function

I happened to see these:

> round(.5, 0)
[1] 0
> round(1.5, 0)
[1] 2
> round(2.5, 0)
[1] 2
> round(3.5, 0)
[1] 4
> round(4.5, 0)
[1] 4


What is the rule here?

Should not round(.5, 0) = 1, round(2.5, 0) = 3 etc?

Thanks and regards,