diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-11-28 11:23:33 -0500 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-11-28 11:23:33 -0500 |
commit | d9cbd78e29d42e70bb46641dd43ee0772c8c975f (patch) | |
tree | 80a67cba4468dbcd89b3cd23ad56695b1f146c66 /source/arduino/long.rst | |
parent | 546b34076d230b617ba86defb6b90cd934b01878 (diff) | |
download | librambutan-d9cbd78e29d42e70bb46641dd43ee0772c8c975f.tar.gz librambutan-d9cbd78e29d42e70bb46641dd43ee0772c8c975f.zip |
reorganized all the arduino/ docs into a lang/ subdirectory since
they're properly CC attributed now.
Diffstat (limited to 'source/arduino/long.rst')
-rw-r--r-- | source/arduino/long.rst | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/source/arduino/long.rst b/source/arduino/long.rst deleted file mode 100644 index cae659a..0000000 --- a/source/arduino/long.rst +++ /dev/null @@ -1,55 +0,0 @@ -.. highlight:: cpp - -.. _arduino-long: - -long -==== - -Description ------------ - -The ``long`` data type stores extended size integer values. You can -use a ``long`` when your values are too large to fit into an :ref:`int -<arduino-int>`. A ``long`` occupies 8 bytes of memory. This yields a -range of approximately -9.2×10^18 to 9.2×10^18 (that's 9.2 billion -billion, or about 92 million times the number of stars in the Milky -Way galaxy). The exact range of a ``long`` on the Maple is from --9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, or -2^63 to -(2^63-1). - -Here's an example of declaring a long (see :ref:`integer constants -<arduino-constants-u-l>` for explanation of the 'L'):: - - // Speed of light in nanometers per second (approximate). - long c = 299792458000000000L; - -The general syntax for declaring an ``long`` variable named ``var``, -then giving it value ``val``, looks like:: - - long var = val; - -This is identical to the ``int`` syntax, with ``long`` replacing -``int``. - -Note that ``long`` values will still :ref:`overflow -<arduino-int-overflow>`, just like ``int`` values, but their much -larger range makes this less likely to happen. - -The downside to using a ``long`` instead of an ``int`` (besides the -extra storage) is that :ref:`arithmetic <arduino-arithmetic>` -operations on ``long``\ s will take longer than on ``int``\ s. - -See Also --------- - -- :ref:`char <arduino-char>` -- :ref:`unsigned char <arduino-unsignedchar>` -- :ref:`int <arduino-int>` -- :ref:`unsigned int <arduino-unsignedint>` -- :ref:`unsigned long <arduino-unsignedlong>` -- :ref:`Integer Constants <arduino-constants-integers>` -- :ref:`Variables <arduino-variables>` - - - -.. include:: cc-attribution.txt
\ No newline at end of file |