[NumPy-Tickets] [NumPy] #1098: variance is inaccurate for arrays of identical, large values

NumPy Trac numpy-tickets@scipy....
Wed Jan 26 10:14:06 CST 2011


#1098: variance is inaccurate for arrays of identical, large values
------------------------+---------------------------------------------------
 Reporter:  thouis      |       Owner:  charris     
     Type:  defect      |      Status:  needs_review
 Priority:  normal      |   Milestone:  Unscheduled 
Component:  numpy.core  |     Version:  devel       
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by bsouthey):

 At least on Linux, this can be addressed by the dtype argument:

 {{{
 import numpy as np
 >>> (np.ones(100000)*10.0**20).var(dtype=np.float64)
 52756253943791624.0
 >>> (np.ones(100000)*10.0**20).var(dtype=np.float128)
 0.0
 }}}

 Of course it just delays the situation when using even larger numbers.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1098#comment:5>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list