Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
combinatorics/permutations: Use floor division
Some code was using the ambiguous division operator on integers. This produces floats by default in Python 3 (1.0 as opposed to 1) which cannot be used as list indices. Fix by using floor division (//) where appropriate. A doctest was also failing, it expected an implicit cast to int (1.0 to 1 automatically). Also remove some redundant casts to int, factorial() returns an int always.
- Loading branch information