Skip to content

Commit

Permalink
Merge pull request #3475 from mjoud/shrdoc
Browse files Browse the repository at this point in the history
fixed shr documentation
  • Loading branch information
dom96 committed Oct 27, 2015
2 parents 82f3cab + f68330e commit b186493
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/system.nim
Expand Up @@ -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.}
Expand Down

0 comments on commit b186493

Please sign in to comment.