On Mon, Aug 27, 2007 at 04:54:21PM -0700, Christopher Barker wrote:
> Stefan van der Walt wrote:
> > but using the Pyrex module, it yields true. You can find the code at
> >
> > http://mentat.za.net/html/refer/somesumbug.tar.bz2
>
> That link appears to be broken.
Sorry, http://mentat.za.net/re
2007/8/28, Stefan van der Walt <[EMAIL PROTECTED]>:
> I find this behaviour odd for addition. Under python:
>
> In [7]: 0.8+0.2 > 1.0
> Out[7]: False
Keep in mind that both 0.2 and 0.8 cannot be represented exactly as
floating-point numbers (unless you use decimal floating points, like
the "decim
2007/8/28, Christopher Barker <[EMAIL PROTECTED]>:
> Stefan van der Walt wrote:
> > but using the Pyrex module, it yields true. You can find the code at
> >
> > http://mentat.za.net/html/refer/somesumbug.tar.bz2
>
> That link appears to be broken.
The correct one is probably:
http://mentat.z
Stefan van der Walt wrote:
> but using the Pyrex module, it yields true. You can find the code at
>
> http://mentat.za.net/html/refer/somesumbug.tar.bz2
That link appears to be broken.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(2
Stefan van der Walt wrote:
> I find this behaviour odd for addition. Under python:
>
> In [7]: 0.8+0.2 > 1.0
> Out[7]: False
>
> but using the Pyrex module, it yields true.
odd. I wonder if one is using extended floating point in the FPU, and
the other not? What hardware/OS/compiler are you us
Hi Chris
On Mon, Aug 27, 2007 at 11:07:00AM -0700, Christopher Barker wrote:
> Is the kahan_sum closer? -- it should be, though compensated summation
> is really for adding LOTS of numbers, for 4, it's pointless at best.
> Anyway, binary floating point has its errors, and compensated summation
Stefan van der Walt wrote:
> For some reason, the kahan_sum of [0.2,0.0,0.8,0.0] is ever so
> slightly larger than 1.0 (in the order of 1e-16), but I'm not sure
> why, yet (this isn't specific to kahan summation -- normal summation
> shows the same behavior).
Just to make sure -- is the khan_sum "
Hi Michael
On Sun, Aug 26, 2007 at 01:45:55PM +0100, Michael Nandris wrote:
> Is there an easy way around this problem, that does not involve fixing the API
> (like using NaN instead of 0.0)?
>
> >>> from numpy.random import multinomial
> >>> multinomial(100,[ 0.2, 0.4, 0.1, 0.3 ])
> array([19, 4
Hi,
Is there an easy way around this problem, that does not involve fixing the API
(like using NaN instead of 0.0)?
>>> from numpy.random import multinomial
>>> multinomial(100,[ 0.2, 0.4, 0.1, 0.3 ])
array([19, 45, 10, 26])
>>> multinomial( 100, [0.2, 0.0, 0.8, 0.0] )
Traceback (most recent cal