Merge pull request #2111 from lyro/fix-2110
fix conditions for int size in 'math.nextPowerOfTwo' #2110
This commit is contained in:
commit
2f62cc91a4
1 changed files with 2 additions and 2 deletions
|
|
@ -93,9 +93,9 @@ proc nextPowerOfTwo*(x: int): int {.noSideEffect.} =
|
|||
result = x - 1
|
||||
when defined(cpu64):
|
||||
result = result or (result shr 32)
|
||||
when sizeof(int) > 16:
|
||||
when sizeof(int) > 2:
|
||||
result = result or (result shr 16)
|
||||
when sizeof(int) > 8:
|
||||
when sizeof(int) > 1:
|
||||
result = result or (result shr 8)
|
||||
result = result or (result shr 4)
|
||||
result = result or (result shr 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue