From f68330e672d596f8e23e236ec941a29914a31255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20J=C3=B6ud?= Date: Sun, 25 Oct 2015 22:28:18 +0100 Subject: [PATCH] fixed shr documentation add docs on shr filling with zeros --- lib/system.nim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 409691e6ac..d611b64c06 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.}