mlz writes:

> I've been playing with the binomial function, and found that in the
> below code, rs *= x does not behave the same way as rs = rs * x. When
> I set FAIL to True, I get a different result.  Both results are below.
>
> I had read that the two were equivalent. What am I missing?

You don't really have rs * x on the right-hand side. You have (rs * x)/y
where rs * x is always divisible by y but x alone is not.

For the record, your actual statement was rs = rs * (n-(i-1))/i, and you
are using Python 2 where / denotes integer division.

Try 3 * 4/6 and 3 * (4/6).
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to