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 | 95783b750fda95f5f4c1fac00ab24da03b31b517 (patch) | |
tree | 2b0bf89c101aa58af5796fbe76c7ec98eebbb0a5 /docs/source/arduino/longcast.rst | |
parent | 3a9a119e9a8ce72c0e1b8fa4d3904bdf84ce355c (diff) | |
download | librambutan-95783b750fda95f5f4c1fac00ab24da03b31b517.tar.gz librambutan-95783b750fda95f5f4c1fac00ab24da03b31b517.zip |
arduino language reference nearing completion, properly CC-BY-SA 3.0 attributed
Diffstat (limited to 'docs/source/arduino/longcast.rst')
-rw-r--r-- | docs/source/arduino/longcast.rst | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/docs/source/arduino/longcast.rst b/docs/source/arduino/longcast.rst index 9f31443..ed23821 100644 --- a/docs/source/arduino/longcast.rst +++ b/docs/source/arduino/longcast.rst @@ -1,3 +1,5 @@ +.. highlight:: cpp + .. _arduino-longcast: long() @@ -6,36 +8,20 @@ long() Description ----------- -Converts a value to the -`long <http://arduino.cc/en/Reference/Long>`_ data type. - - - -Syntax ------- - -long(x) - - - -Parameters ----------- +Converts a value to the :ref:`long <arduino-long>` data type. Here is +an example:: -x: a value of any type + double d = 2.5; + long i = long(d); // i holds "2L", an long value +The value inside of the parentheses (``long(...)``) 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:`long <arduino-long>` reference for details about the +precision and limitations of ``long`` variables on the Maple. -Returns -------- - -long - - - -See also +See Also -------- - -- `long <http://arduino.cc/en/Reference/Long>`_ - - +- :ref:`long <arduino-long>` |