Re: [R] operators %/% bug?

From: jim holtman <jholtman_at_gmail.com>
Date: Mon, 31 Mar 2008 11:14:40 -0500

FAQ 7.31 a-b != 0.2

> a <- 1.2
>
> b <- 1.0
>
> a-b-.2
[1] -5.551115e-17
>

On 3/31/08, Lo, Ken <Ken.Lo_at_roswellpark.org> wrote:
> Dear all,
>
>
>
> I have come across a strange behavior of the %/% operator, and I wasn't
> sure if this was intended.
>
>
>
> i.e.
>
> a <- 1.2
>
> b <- 1.0
>
> (a-b) %/% 0.1 results in 1?
>
> Whereas
>
> 0.2 %/% 0.1 results in 2.
>
>
>
> Am I missing something obvious here? It seems to be consistent up to R
> 2.6.0 running in WinXP (haven't upgraded yet).
>
>
>
> Best,
>
>
>
> Ken
>
>
>
> This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 31 Mar 2008 - 16:18:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 31 Mar 2008 - 17:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive