system.nim: documentation improvements
This commit is contained in:
parent
714c4f0d67
commit
7c08303faf
2 changed files with 22 additions and 20 deletions
|
|
@ -1322,13 +1322,16 @@ when defined(nimAshr):
|
||||||
## Shifts right by pushing copies of the leftmost bit in from the left,
|
## Shifts right by pushing copies of the leftmost bit in from the left,
|
||||||
## and let the rightmost bits fall off.
|
## and let the rightmost bits fall off.
|
||||||
##
|
##
|
||||||
|
## Note that `ashr` is not an operator so use the normal function
|
||||||
|
## call syntax for it.
|
||||||
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `shr proc <#shr,int,SomeInteger>`_
|
## * `shr proc <#shr,int,SomeInteger>`_
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## 0b0001_0000'i8 shr 2 == 0b0000_0100'i8
|
## ashr(0b0001_0000'i8, 2) == 0b0000_0100'i8
|
||||||
## 0b1000_0000'i8 shr 8 == 0b1111_1111'i8
|
## ashr(0b1000_0000'i8, 8) == 0b1111_1111'i8
|
||||||
## 0b1000_0000'i8 shr 1 == 0b1100_0000'i8
|
## ashr(0b1000_0000'i8, 1) == 0b1100_0000'i8
|
||||||
proc ashr*(x: int8, y: SomeInteger): int8 {.magic: "AshrI", noSideEffect.}
|
proc ashr*(x: int8, y: SomeInteger): int8 {.magic: "AshrI", noSideEffect.}
|
||||||
proc ashr*(x: int16, y: SomeInteger): int16 {.magic: "AshrI", noSideEffect.}
|
proc ashr*(x: int16, y: SomeInteger): int16 {.magic: "AshrI", noSideEffect.}
|
||||||
proc ashr*(x: int32, y: SomeInteger): int32 {.magic: "AshrI", noSideEffect.}
|
proc ashr*(x: int32, y: SomeInteger): int32 {.magic: "AshrI", noSideEffect.}
|
||||||
|
|
@ -3726,7 +3729,7 @@ proc quit*(errormsg: string, errorcode = QuitFailure) {.noReturn.} =
|
||||||
{.pop.} # hints
|
{.pop.} # hints
|
||||||
|
|
||||||
proc `/`*(x, y: int): float {.inline, noSideEffect.} =
|
proc `/`*(x, y: int): float {.inline, noSideEffect.} =
|
||||||
## Division of intergers that results in a float.
|
## Division of integers that results in a float.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `div <#div,int,int>`_
|
## * `div <#div,int,int>`_
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
System module imports several separate modules, and their documentation
|
The System module imports several separate modules, and their documentation
|
||||||
is in separate files:
|
is in separate files:
|
||||||
|
|
||||||
* `iterators <iterators.html>`_
|
* `iterators <iterators.html>`_
|
||||||
* `assertions <assertions.html>`_
|
* `assertions <assertions.html>`_
|
||||||
* `dollars <dollars.html>`_
|
* `dollars <dollars.html>`_
|
||||||
|
|
@ -38,8 +39,6 @@ Proc Usage
|
||||||
easier substring extraction than regular expressions
|
easier substring extraction than regular expressions
|
||||||
* `strtabs module <strtabs.html>`_ for efficient hash tables
|
* `strtabs module <strtabs.html>`_ for efficient hash tables
|
||||||
(dictionaries, in some programming languages) mapping from strings to strings
|
(dictionaries, in some programming languages) mapping from strings to strings
|
||||||
* `ropes module<ropes.html>`_ for rope data type, which can represent very
|
|
||||||
long strings efficiently
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -62,7 +61,7 @@ Proc Usage
|
||||||
`del<#del,seq[T][T],Natural>`_ `O(1)` removal, doesn't preserve the order
|
`del<#del,seq[T][T],Natural>`_ `O(1)` removal, doesn't preserve the order
|
||||||
`pop<#pop,seq[T][T]>`_ Remove and return last item of a sequence
|
`pop<#pop,seq[T][T]>`_ Remove and return last item of a sequence
|
||||||
`x & y<#&,seq[T][T],seq[T][T]>`_ Concatenate two sequences
|
`x & y<#&,seq[T][T],seq[T][T]>`_ Concatenate two sequences
|
||||||
`x[a..b]<#[],openArray[T],HSlice[U,V]>`_ Slice of a seqence (both ends included)
|
`x[a..b]<#[],openArray[T],HSlice[U,V]>`_ Slice of a sequence (both ends included)
|
||||||
======================================== ==========================================
|
======================================== ==========================================
|
||||||
|
|
||||||
**See also:**
|
**See also:**
|
||||||
|
|
@ -163,6 +162,6 @@ Proc Usage
|
||||||
`not T<#not,bool>`_ Boolean `not`
|
`not T<#not,bool>`_ Boolean `not`
|
||||||
`a .. b<#..,T,U>`_ Binary slice that constructs an interval
|
`a .. b<#..,T,U>`_ Binary slice that constructs an interval
|
||||||
`[a, b]`
|
`[a, b]`
|
||||||
[a ..< b](#..<.t,untyped,untyped) Interval `[a, b>` (excluded upper bound)
|
[a ..< b](#..<.t,untyped,untyped) Interval `[a, b)` (excluded upper bound)
|
||||||
[runnableExamples](#runnableExamples,untyped) Create testable documentation
|
[runnableExamples](#runnableExamples,untyped) Create testable documentation
|
||||||
============================================= ============================================
|
============================================= ============================================
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue