Skip to content

Commit

Permalink
[backport] correctly document toInt, fixes #2764 [ci skip] (#10176)
Browse files Browse the repository at this point in the history
(cherry picked from commit 77166ba)
  • Loading branch information
narimiran committed Jan 4, 2019
1 parent 1134f85 commit 82818d2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1772,14 +1772,16 @@ proc toBiggestFloat*(i: BiggestInt): BiggestFloat {.
proc toInt*(f: float): int {.
magic: "ToInt", noSideEffect, importc: "toInt".}
## converts a floating point number `f` into an ``int``. Conversion
## rounds `f` if it does not contain an integer value. If the conversion
## fails (because `f` is infinite for example), `ValueError` is raised.
## rounds `f` if it does not contain an integer value.
## Note that some floating point numbers (e.g. infinity) cannot be
## accurately converted.

proc toBiggestInt*(f: BiggestFloat): BiggestInt {.
magic: "ToBiggestInt", noSideEffect, importc: "toBiggestInt".}
## converts a biggestfloat `f` into a ``biggestint``. Conversion
## rounds `f` if it does not contain an integer value. If the conversion
## fails (because `f` is infinite for example), `ValueError` is raised.
## rounds `f` if it does not contain an integer value.
## Note that some floating point numbers (e.g. infinity) cannot be
## accurately converted.

proc addQuitProc*(QuitProc: proc() {.noconv.}) {.
importc: "atexit", header: "<stdlib.h>".}
Expand Down

0 comments on commit 82818d2

Please sign in to comment.