[R] [External] Calculation error found

Richard M. Heiberger rmh @end|ng |rom temp|e@edu
Thu Apr 7 19:56:55 CEST 2022


Probably numerical precision.  See FAQ 7.31 which is on your computer.
Enter
     system(paste("open",file.path(base::system.file(), "../../doc/manual/R-FAQ.pdf")))
and the FAQ file will open.

x <- 20
y <- 19.99999999999999
x-y
x == y

> On Apr 07, 2022, at 12:20, Sara Bortot <sarabortot11 using gmail.com> wrote:
> 
> Good evening,
> I was doing some calculations with R when I noticed an error in one of
> the answers.
> I am attaching the screenshot of the page. There you will see that the two
> calculations are written in a different way but they should give the same
> result, because they're equivalent.
> Let me know if it is a solvable problem,
> 
> Kind regards
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=04%7C01%7Crmh%40temple.edu%7C415d01fbba264cd4d1ad08da18bc8805%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637849495421702100%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=v0xknDQUdAFoQ7HK8fDegMcGLOHuasMkQHq9XqazQlg%3D&reserved=0
> PLEASE do read the posting guide https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.r-project.org%2Fposting-guide.html&data=04%7C01%7Crmh%40temple.edu%7C415d01fbba264cd4d1ad08da18bc8805%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637849495421702100%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=lVntKkDO9OnmMrZslJhZU8VydPepHERDjSTSsOTb9wY%3D&reserved=0
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list