summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorFrank Fischer <frank-fischer@shadow-soft.de>2015-02-12 12:47:58 +0100
committerFrank Fischer <frank-fischer@shadow-soft.de>2015-02-12 12:47:58 +0100
commitfcfaf2a844432a6bd01147ff58ac7197a00999cb (patch)
tree8c624f99e6150c960c58258d40f1f6d0ae50cdd0 /lib
parent4f00ae5a5afd0702a286a31f6bbdbdd8745be8c5 (diff)
downloadNim-fcfaf2a844432a6bd01147ff58ac7197a00999cb.tar.gz
fix conditions for int size in 'math.nextPowerOfTwo' #2110
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/math.nim4
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)