[R] strange floor rounding

Peter Ehlers ehlers at ucalgary.ca
Fri Jul 9 16:42:34 CEST 2010


On 2010-07-09 8:27, Trafim Vanishek wrote:
> Thanks everybody for referring me to FAQ 7.31 but I don't see how to solve
> it.
> I am giving a concrete number and I need to get 58 not 57. Seems, there is
> no way?

Sure there is: round(100*0.58).

   -Peter Ehlers

>
> On Fri, Jul 9, 2010 at 4:05 PM, David Winsemius<dwinsemius at comcast.net>wrote:
>
>>
>> On Jul 9, 2010, at 9:46 AM, Trafim Vanishek wrote:
>>
>>   Dear all,
>>>
>>> might seem and easy question but I cannot figure it out.
>>>
>>> floor(100*(.58))
>>> [1] 57
>>>
>>> where is the trick here?
>>>
>>
>> FAQ 7.31
>>
>>
>> And how can I end up with the right answer?
>>>
>>
>> Define right, please. (There have been several questions in the last week
>> for which FAQ 7.31 was the answer and some of the responses had useful
>> links.)
>>
>> --
>> David Winsemius, MD
>> West Hartford, CT
>>
>>



More information about the R-help mailing list