diff options
author | Frank Fischer <frank-fischer@shadow-soft.de> | 2015-02-12 12:47:58 +0100 |
---|---|---|
committer | Frank Fischer <frank-fischer@shadow-soft.de> | 2015-02-12 12:47:58 +0100 |
commit | fcfaf2a844432a6bd01147ff58ac7197a00999cb (patch) | |
tree | 8c624f99e6150c960c58258d40f1f6d0ae50cdd0 /lib | |
parent | 4f00ae5a5afd0702a286a31f6bbdbdd8745be8c5 (diff) | |
download | Nim-fcfaf2a844432a6bd01147ff58ac7197a00999cb.tar.gz |
fix conditions for int size in 'math.nextPowerOfTwo' #2110
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/math.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/math.nim b/lib/pure/math.nim index b9e057e78..62ea1f756 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -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) |