summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorMathieu Bridon <[email protected]>2018-07-25 11:53:54 +0200
committerDylan Baker <[email protected]>2018-08-07 13:07:44 -0700
commit9b6746b7c0bef64be419c8cf2ecd916980e2718a (patch)
tree1c84ed2623ee06a682459cc5d1dcd3e662d04285 /src/compiler/nir
parent3dc22381fa6ae6e5964908490f65e2903bd1b38d (diff)
python: Use explicit integer divisions
In Python 2, divisions of integers 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 scripts compatible with both Python 2 and 3. In addition, using __future__.division tells Python 2 to behave the same way as Python 3, which helps ensure the scripts produce the same output in both versions of Python. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v2) Reviewed-by: Dylan Baker <[email protected]>
Diffstat (limited to 'src/compiler/nir')
0 files changed, 0 insertions, 0 deletions