On 16 Sep 2016, at 12:41 , Alexis Sarda <alexis.sa...@gmail.com> wrote:

> Hello,
> 
> while testing the crossprod() function under Linux, I noticed the following:
> 
> set.seed(883)
> x <- rnorm(100)
> x %*% x - sum(x^2) # equal to 1.421085e-14
> 
> Is this difference normal? It seems to be rather large for double precision.
> 

It's less than .Machine$double.eps, relative (!) to x  %*% x ~= 100.

-pd

> Regards,
> Alexis.
> 
>       [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd....@cbs.dk  Priv: pda...@gmail.com

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to