1 |
Dnia 2014-08-11, o godz. 21:51:34 |
2 |
Michał Górny <mgorny@g.o> napisał(a): |
3 |
|
4 |
> In Python 2, the division ('/') operator defaults to integer |
5 |
> (truncating) division when given integer argument. In Python 3, it |
6 |
> performs floating-point division unconditionally instead. To overcome |
7 |
> this difference and get a consistent behavior, integers were converted |
8 |
> to floats explicitly in a few places. |
9 |
> |
10 |
> Instead, use a simpler 'from __future__ import division' statement that |
11 |
> enables floating-point division globally in Python 2. Use it in all |
12 |
> relevant files to get a consistent behavior, and use '//' appropriately |
13 |
> whenever integer division is desired. |
14 |
|
15 |
More specifically, this one's in git. Sorry for the extra thread. |
16 |
|
17 |
-- |
18 |
Best regards, |
19 |
Michał Górny |