summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMagnus Jöud <magnus.joud@med.lu.se>2015-10-25 22:28:18 +0100
committerMagnus Jöud <magnus.joud@med.lu.se>2015-10-26 00:45:48 +0100
commitf68330e672d596f8e23e236ec941a29914a31255 (patch)
tree0e0e41f396bc5b367fd1e53d78af54dfde842906
parentaa36e73ecf1e09367a5e94de6c3af488449eb4f6 (diff)
downloadNim-f68330e672d596f8e23e236ec941a29914a31255.tar.gz
fixed shr documentation
add docs on shr filling with zeros
-rw-r--r--lib/system.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 409691e6a..d611b64c0 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -868,12 +868,13 @@ proc `shr` *(x, y: int8): int8 {.magic: "ShrI", noSideEffect.}
 proc `shr` *(x, y: int16): int16 {.magic: "ShrI", noSideEffect.}
 proc `shr` *(x, y: int32): int32 {.magic: "ShrI", noSideEffect.}
 proc `shr` *(x, y: int64): int64 {.magic: "ShrI", noSideEffect.}
-  ## computes the `shift right` operation of `x` and `y`.
+  ## computes the `shift right` operation of `x` and `y`, filling
+  ## vacant bit positions with zeros.
   ##
   ## .. code-block:: Nim
-  ##   0b0001_0000'i8 shr 2 == 0b0100_0000'i8
-  ##   0b1000_0000'i8 shr 2 == 0b0000_0000'i8
-  ##   0b0000_0001'i8 shr 9 == 0b0000_0000'i8
+  ##   0b0001_0000'i8 shr 2 == 0b0000_0100'i8
+  ##   0b1000_0000'i8 shr 8 == 0b0000_0000'i8
+  ##   0b0000_0001'i8 shr 1 == 0b0000_0000'i8
 
 proc `shl` *(x, y: int): int {.magic: "ShlI", noSideEffect.}
 proc `shl` *(x, y: int8): int8 {.magic: "ShlI", noSideEffect.}