diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-10-25 21:15:28 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-11-17 12:44:28 -0500 |
commit | 2d429e75ce69e77f8c95490ac03881ec9aa0354a (patch) | |
tree | a3b810a6c75625b07a4b976e5d1e319c60e19a6b /source/arduino/intcast.rst | |
parent | 30ac55d80c18e93f9c39a6dd850c10f9e7fd92ac (diff) | |
download | librambutan-2d429e75ce69e77f8c95490ac03881ec9aa0354a.tar.gz librambutan-2d429e75ce69e77f8c95490ac03881ec9aa0354a.zip |
arduino language reference nearing completion, properly CC-BY-SA 3.0 attributed
Diffstat (limited to 'source/arduino/intcast.rst')
-rw-r--r-- | source/arduino/intcast.rst | 38 |
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>` |