[R] Rounding of problem with sum command in R

niharika singhal niharikasinghal1990 at gmail.com
Tue Aug 22 16:26:46 CEST 2017


Hello I have a vector
v=c(0.08844446,0.1744455,0.1379778,0.1209769,0.1573065,0.1134463,0.2074027)
when i do
sum(v)
or
0.08844446+0.1744455+0.1379778+0.1209769+0.1573065+0.1134463+0.2074027
i am getting output as 1
But if i add them manually i get
1.00000026
I do not want to round of my value since it effect my code further
Can anyone suggest how can i avoid this.

Thanks & Regards
Niharika Singhal

	[[alternative HTML version deleted]]



More information about the R-help mailing list