Skip to content
Prev 86745 / 398506 Next

Variance for Vector of Constants is STILL Not Zero

On 2/17/2006 1:17 PM, Barry Zajdlik wrote:
My guess is that you've got a video driver or some other software that's 
messing with your floating point processor, reducing the precision from 
64 bit to 53 or less.  I can reproduce the error after running 
RSiteSearch, which messes with my fpu in that way:

 > var(rep(0.2, 100))
[1] 0
 > RSiteSearch('fpu')
A search query has been submitted to http://search.r-project.org
The results page should open in your browser shortly
 > var(rep(0.2, 100))
[1] 1.525181e-31

(I'm not blaming RSiteSearch for doing something bad, it's the system 
DLLs that it calls that are at fault.)

I think this is something we should address, but it's not easy.

Duncan Murdoch