aboutsummaryrefslogtreecommitdiffstats
path: root/source/arduino/intcast.rst
diff options
context:
space:
mode:
Diffstat (limited to 'source/arduino/intcast.rst')
-rw-r--r--source/arduino/intcast.rst38
1 files changed, 13 insertions, 25 deletions
diff --git a/source/arduino/intcast.rst b/source/arduino/intcast.rst
index d6bcca4..4db65d2 100644
--- a/source/arduino/intcast.rst
+++ b/source/arduino/intcast.rst
@@ -1,3 +1,5 @@
+.. highlight:: cpp
+
.. _arduino-intcast:
int()
@@ -6,36 +8,22 @@ int()
Description
-----------
-Converts a value to the `int <http://arduino.cc/en/Reference/Int>`_
-data type.
-
-
-
-Syntax
-------
-
-int(x)
-
-
+Converts a value to the :ref:`int <arduino-int>` data type. Here is
+an example::
-Parameters
-----------
+ double d = 2.5;
+ int i = int(d); // i holds "2", an int value
-x: a value of any type
+The value inside of the parentheses (``int(...)``) can be of any type.
+However, if it is not a numeric type (like ``double``, ``char``,
+etc.), you will get strange results.
+See the :ref:`int <arduino-int>` reference for details about the
+precision and limitations of ``int`` variables on the Maple.
-
-Returns
--------
-
-int
-
-
-
-See also
+See Also
--------
-
-- `int <http://arduino.cc/en/Reference/Int>`_
+- :ref:`int <arduino-int>`