fixed shr documentation

add docs on shr filling with zeros
This commit is contained in:
Magnus Jöud
2015-10-25 22:28:18 +01:00
parent aa36e73ecf
commit f68330e672

View File

@@ -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.}