[R] Question about converting from square roots to decimals and back

2007-01-20 Thread Robert Barber
Hi, I apologize if there is a simple answer to this question that I've missed. I did search the mailing list but I might not have used the right keywords. Why does sum(A3^2) give the result of 1, but sum(A3^2)==1 give the result of FALSE? A3-matrix(nrow=3,c(1/(2^.5),1/(2^.5),0)) A3

Re: [R] Question about converting from square roots to decimals and back

2007-01-20 Thread Marc Schwartz
On Sat, 2007-01-20 at 14:00 -0500, Robert Barber wrote: Hi, I apologize if there is a simple answer to this question that I've missed. I did search the mailing list but I might not have used the right keywords. Why does sum(A3^2) give the result of 1, but sum(A3^2)==1 give the result of

[R] Question about converting from square roots to decimals and back

2007-01-20 Thread Robert Barber
Thank you very much. That was what I needed to know. Bob B. __ R-help@stat.math.ethz.ch 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,

Re: [R] Question about converting from square roots to decimals and back

2007-01-20 Thread Andrew Robinson
Hi Robert, does this help? http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f A3-matrix(nrow=3,c(1/(2^.5),1/(2^.5),0)) sum(A3^2)==1 all.equal(sum(A3^2), 1) Cheers, Andrew On Sat, Jan 20, 2007 at 02:00:18PM -0500, Robert Barber wrote: Hi, I