[Numpy-discussion] numpy.random.multinomial() cannot handle zero's

Lino Mastrodomenico l.mastrodomenico at gmail.com
Mon Aug 27 20:39:51 EDT 2007

2007/8/28, Stefan van der Walt <stefan at sun.ac.za>:
> 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 "decimal" module), so the starting point isn't what it appears to

> Sum: 1.00000000000000000000000000000000000000000000000000
> Is greater than 1.0? True

I get True on a x86, gcc-3.3.1, numpy-1.0b5, GNU/Linux box, and False
on x86_64, gcc-4.1.1, numpy-, GNU/Linux.

YMMV ;-)

Lino Mastrodomenico
E-mail: l.mastrodomenico at gmail.com

More information about the NumPy-Discussion mailing list