Re: [Mesa-dev] [PATCH v2 10/26] python: Use explicit integer divisions

2018-07-24 Thread Dylan Baker
Quoting Eric Engestrom (2018-07-24 09:42:57) > On Wednesday, 2018-07-11 19:52:31 +0200, Mathieu Bridon wrote: > > In Python 2, divisions return an integer: ^ of integers Since 32 / 4.0 returns 8.0 > > > > >>> 32 / 4 > > 8 > > > > In Python 3 though, they

Re: [Mesa-dev] [PATCH v2 10/26] python: Use explicit integer divisions

2018-07-24 Thread Eric Engestrom
On Wednesday, 2018-07-11 19:52:31 +0200, Mathieu Bridon wrote: > In Python 2, divisions return an integer: > > >>> 32 / 4 > 8 > > In Python 3 though, they return floats: > > >>> 32 / 4 > 8.0 > > However, Python 3 has an explicit integer division operator: > > >>> 32 // 4 >

[Mesa-dev] [PATCH v2 10/26] python: Use explicit integer divisions

2018-07-11 Thread Mathieu Bridon
In Python 2, divisions return an integer: >>> 32 / 4 8 In Python 3 though, they return floats: >>> 32 / 4 8.0 However, Python 3 has an explicit integer division operator: >>> 32 // 4 8 That operator exists on Python >= 2.2, so let's use it everywhere to make the