summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-12-14 11:50:23 +0100
committerAraq <rumpf_a@web.de>2014-12-14 11:50:23 +0100
commit516a4d933f9b5e87c670565dc03bdc755896bb2b (patch)
treea6171df02316c6316dea9ad7caaac925c17eb72d /doc
parent9724bd4e1b44a23650b0f74c90766fe937ad778b (diff)
parent9607354729e97d99f756b32e803e3f974b3c0d0e (diff)
downloadNim-516a4d933f9b5e87c670565dc03bdc755896bb2b.tar.gz
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Diffstat (limited to 'doc')
-rw-r--r--doc/tut1.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/tut1.txt b/doc/tut1.txt
index 80ab2aab3..9d75b1ea2 100644
--- a/doc/tut1.txt
+++ b/doc/tut1.txt
@@ -957,6 +957,19 @@ versa. The `toInt <system.html#toInt>`_ and `toFloat <system.html#toFloat>`_
 procs can be used for these conversions.
 
 
+Type Conversion
+---------------
+Conversion between basic types in nim is performed by using the
+type as a function:
+
+.. code-block:: nim
+  var
+    x: int32 = 1.int32   # same as calling int32(1)
+    y: int8  = int8('a') # 'a' == 97'i8
+    z: float = 2.5       # int(2.5) rounds down to 2
+    sum: int = int(x) + int(y) + int(z) # sum == 100
+
+
 Internal type representation
 ============================