summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2019-01-04 09:25:58 +0100
committerGitHub <noreply@github.com>2019-01-04 09:25:58 +0100
commit77166ba795b03d4536f8efb0f225ba3ffc8531be (patch)
tree8be3ca6b7b1a5bb21204c33766d773d089a53cd8 /lib/system.nim
parente6cbf9e79014e2fb6851796adda251eed1abcfd5 (diff)
downloadNim-77166ba795b03d4536f8efb0f225ba3ffc8531be.tar.gz
[backport] correctly document `toInt`, fixes #2764 [ci skip] (#10176)
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/system.nim b/lib/system.nim
index cab8a91aa..9fa889b11 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1799,14 +1799,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>".}