aboutsummaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-02-09 21:10:34 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2011-02-09 21:10:34 -0500
commit9768ee6b2f60442676613c154ad784b30191711c (patch)
treebef1b50fde1ea3eafc89124b31dae82979ca8d14 /source
parent9ea60c7e7dffd06791ec2dc62ffab3f2bf802f08 (diff)
downloadlibrambutan-9768ee6b2f60442676613c154ad784b30191711c.tar.gz
librambutan-9768ee6b2f60442676613c154ad784b30191711c.zip
Fixed docs bug where we say "long" when we mean "long long"
Diffstat (limited to 'source')
-rw-r--r--source/external-interrupts.rst10
-rw-r--r--source/lang/api/constants.rst14
-rw-r--r--source/lang/api/hardwaretimer.rst2
-rw-r--r--source/lang/api/millis.rst2
-rw-r--r--source/lang/api/random.rst8
-rw-r--r--source/lang/cpp/arithmetic.rst2
-rw-r--r--source/lang/cpp/assignment.rst28
-rw-r--r--source/lang/cpp/built-in-types.rst2
-rw-r--r--source/lang/cpp/compoundbitwise.rst17
-rw-r--r--source/lang/cpp/doublecast.rst2
-rw-r--r--source/lang/cpp/enum.rst3
-rw-r--r--source/lang/cpp/int.rst8
-rw-r--r--source/lang/cpp/keywords.rst13
-rw-r--r--source/lang/cpp/long.rst52
-rw-r--r--source/lang/cpp/longcast.rst4
-rw-r--r--source/lang/cpp/longlong.rst56
-rw-r--r--source/lang/cpp/return.rst2
-rw-r--r--source/lang/cpp/unsignedint.rst8
-rw-r--r--source/lang/cpp/unsignedlong.rst41
-rw-r--r--source/lang/cpp/unsignedlonglong.rst43
-rw-r--r--source/lang/cpp/variables.rst2
-rw-r--r--source/language.rst74
22 files changed, 200 insertions, 193 deletions
diff --git a/source/external-interrupts.rst b/source/external-interrupts.rst
index 5187ca4..b2cbbb1 100644
--- a/source/external-interrupts.rst
+++ b/source/external-interrupts.rst
@@ -84,14 +84,8 @@ The following table shows which pins can be used on which lines.
Function Reference
------------------
-.. doxygenfunction:: attachInterrupt
-
-.. doxygenfunction:: detachInterrupt
-
-.. doxygenenum:: ExtIntTriggerMode
-
-.. doxygentypedef:: voidFuncPtr
-
+- :ref:`attachInterrupt() <lang-attachinterrupt>`
+- :ref:`detachInterrupt() <lang-detachinterrupt>`
Code example
------------
diff --git a/source/lang/api/constants.rst b/source/lang/api/constants.rst
index 4426293..72738b8 100644
--- a/source/lang/api/constants.rst
+++ b/source/lang/api/constants.rst
@@ -242,10 +242,18 @@ type, follow it with:
For example, ``33U`` is an :ref:`unsigned int <lang-unsignedint>`.
- an ``l`` or ``L`` to interpret the constant as a long value. For
- example, ``100000L`` is a :ref:`long <lang-long>`.
+ example, ``100000L`` is a :ref:`long <lang-long>`. On the Maple,
+ ``long`` is just a synonym for ``int``.
- a ``ul`` or ``UL`` to do both. For example, ``32767UL`` is an
- :ref:`unsigned long <lang-unsignedlong>`.
+ :ref:`unsigned long <lang-unsignedlong>`. On the Maple, ``unsigned
+ long`` is just a synonym for ``unsigned int``.
+
+- an ``ll`` or ``LL`` to interpret the constant as a :ref:`long long
+ <lang-longlong>` value.
+
+- a ``ull`` or ``ULL`` to interpret the constant as an :ref:`unsigned
+ long long <lang-unsignedlonglong>`.
.. _lang-constants-fp:
@@ -321,6 +329,8 @@ See Also
- :ref:`unsigned int <lang-unsignedint>`
- :ref:`long <lang-long>`
- :ref:`unsigned long <lang-unsignedlong>`
+- :ref:`long long <lang-longlong>`
+- :ref:`unsigned long long <lang-unsignedlonglong>`
- :ref:`float <lang-float>`
- :ref:`double <lang-double>`
diff --git a/source/lang/api/hardwaretimer.rst b/source/lang/api/hardwaretimer.rst
index 258471b..3e5424c 100644
--- a/source/lang/api/hardwaretimer.rst
+++ b/source/lang/api/hardwaretimer.rst
@@ -317,6 +317,8 @@ For example, to set the prescale factor on timer 1 to 5, call
The :ref:`setPeriod() <lang-hardwaretimer-setperiod>` method may
also be used as a convenient alternative.
+.. _lang-hardwaretimer-resume:
+
.. cpp:function:: void HardwareTimer::resume()
Resume a paused timer, without affecting its configuration.
diff --git a/source/lang/api/millis.rst b/source/lang/api/millis.rst
index 54e4507..0288c56 100644
--- a/source/lang/api/millis.rst
+++ b/source/lang/api/millis.rst
@@ -40,7 +40,7 @@ Tip
Since the return value for ``millis()`` is an :ref:`unsigned long
<lang-unsignedlong>`, overflow errors may occur if you try to do math
-with other data types, such as :ref:`ints <lang-int>`.
+with other data types, such as :ref:`chars <lang-char>`.
See Also
--------
diff --git a/source/lang/api/random.rst b/source/lang/api/random.rst
index f2a9762..dd8871d 100644
--- a/source/lang/api/random.rst
+++ b/source/lang/api/random.rst
@@ -7,13 +7,13 @@ random()
The ``random()`` function generates pseudo-random numbers.
-.. TODO keep tracking Sphinx/Breathe's ability to reference overloaded
-.. functions so we can use doxygenfunction instead of manually
-.. documenting this.
-
Library Documentation
---------------------
+.. FIXME keep tracking Sphinx/Breathe's ability to reference
+.. overloaded functions so we can use doxygenfunction instead of
+.. manually documenting.
+
.. cpp:function:: random(long max)
Same as a call to ``random(0, max)``.
diff --git a/source/lang/cpp/arithmetic.rst b/source/lang/cpp/arithmetic.rst
index 91fe22e..7e8c3fc 100644
--- a/source/lang/cpp/arithmetic.rst
+++ b/source/lang/cpp/arithmetic.rst
@@ -97,7 +97,7 @@ particular, on Maple, ints do not overflow (become negative) until
they reach 2,147,483,648; on the Arduino, they overflow at 32,767.
Because of this, programs running on Maple are much less likely to run
into overflow issues. The following table summarizes the sizes and
-ranges of integer datatypes on the Maple (the ranges of long long
+ranges of integer datatypes on the Maple (the ranges of ``long long``
types are approximate):
.. _lang-arithmetic-int-sizes:
diff --git a/source/lang/cpp/assignment.rst b/source/lang/cpp/assignment.rst
index b6ad4d5..f9430b4 100644
--- a/source/lang/cpp/assignment.rst
+++ b/source/lang/cpp/assignment.rst
@@ -15,47 +15,38 @@ operator tells the microcontroller to evaluate whatever value or
expression is on the right side of the equal sign, and store it in
the variable to the left of the equal sign [#fgross]_.
-
-
Example
-------
::
int sensVal; // declare an integer variable named sensVal
- senVal = analogRead(0); // store the (digitized) input voltage at analog pin 0 in SensVal
-
-
+ sensVal = analogRead(0); // store the (digitized) input voltage at analog pin 0 in sensVal
Programming Tips
----------------
-The variable on the left side of the assignment operator ( = sign )
+The variable on the left side of the assignment operator (``=`` sign)
needs to be able to hold the value stored in it. If it is not large
enough to hold a value, the value stored in the variable will be
incorrect.
-Don't confuse the assignment operator [ = ] (single equal sign)
-with the comparison operator [ == ] (double equal signs), which
-evaluates whether two expressions are equal.
-
+Don't confuse the assignment operator ``=`` (single equal sign) with
+the comparison operator ``==`` (double equal signs), which evaluates
+whether two expressions are equal.
Arduino Compatibility
---------------------
Assignments on the Maple are identical to those on Arduino.
-
-
See Also
--------
-
-- `if (comparison operators) <http://arduino.cc/en/Reference/If>`_
-- `char <http://arduino.cc/en/Reference/Char>`_
-- `int <http://arduino.cc/en/Reference/Int>`_
-- `long <http://arduino.cc/en/Reference/Long>`_
-
+- :ref:`if <lang-if>`
+- :ref:`char <lang-char>`
+- :ref:`int <lang-int>`
+- :ref:`long long <lang-longlong>`
.. rubric:: Footnotes
@@ -66,5 +57,4 @@ See Also
<http://icu-project.org/docs/papers/cpp_report/the_anatomy_of_the_assignment_operator.html>`_
for more information.
-
.. include:: cc-attribution.txt
diff --git a/source/lang/cpp/built-in-types.rst b/source/lang/cpp/built-in-types.rst
index 1323db8..a7349e6 100644
--- a/source/lang/cpp/built-in-types.rst
+++ b/source/lang/cpp/built-in-types.rst
@@ -33,7 +33,7 @@ Integral types
.. cpp:type:: long
- 64-bit integer value.
+ 32-bit integer value.
.. cpp:type:: long long
diff --git a/source/lang/cpp/compoundbitwise.rst b/source/lang/cpp/compoundbitwise.rst
index a4bbb24..8231130 100644
--- a/source/lang/cpp/compoundbitwise.rst
+++ b/source/lang/cpp/compoundbitwise.rst
@@ -31,8 +31,8 @@ value of ``y``::
x &= y; // equivalent to x = x & y;
You can use any integer variable for ``x`` (i.e., any variable of type
-``int``, ``long``, ``char``, ``byte``, etc.). You can use either an
-integer variable or any :ref:`integer value
+``int``, ``char``, ``byte``, ``long long``, etc.). You can use either
+an integer variable or any :ref:`integer value
<lang-constants-integers>` (like ``3`` or ``0x20``) for ``y``.
Before doing an example of ``&=``, let's first review the Bitwise AND
@@ -115,9 +115,9 @@ its old value bitwise ORed with the value of ``y``::
x |= y; // equivalent to x = x | y;
You can use any integer variable for ``x`` (i.e., any variable of type
-``int``, ``long``, ``char``, ``byte``, etc.). You can use either an
-integer variable or any integer value (like ``3`` or ``0x20``) for
-``y``. (This works the same way as :ref:`compound bitwise AND
+``int``, ``char``, ``long long`` etc.). You can use either an integer
+variable or any integer value (like ``3`` or ``0x20``) for ``y``.
+(This works the same way as :ref:`compound bitwise AND
<lang-compoundbitwise-and>`\ , ``&=``).
Before doing an example of ``|=``, let's first review the Bitwise OR
@@ -178,12 +178,11 @@ will be equal to its old value bitwise XORed with the value of ``y``::
x ^= y; // equivalent to x = x ^ y;
You can use any integer variable for ``x`` (i.e., any variable of type
-``int``, ``long``, ``char``, ``byte``, etc.). You can use either an
+``int``, ``char``, ``long long``, etc.). You can use either an
integer variable or any integer value (like ``3`` or ``0x20``) for
``y``. (This works the same way as :ref:`&=
-<lang-compoundbitwise-and>` and :ref:`\|=
-<lang-compoundbitwise-or>`; in fact, these three operators all
-work the same in this way).
+<lang-compoundbitwise-and>` and :ref:`\|= <lang-compoundbitwise-or>`;
+in fact, these three operators all work the same in this way).
Before doing an example of ``^=``, let's first review the Bitwise
XOR operator, ``^``::
diff --git a/source/lang/cpp/doublecast.rst b/source/lang/cpp/doublecast.rst
index 511fe24..16a9907 100644
--- a/source/lang/cpp/doublecast.rst
+++ b/source/lang/cpp/doublecast.rst
@@ -12,7 +12,7 @@ data type. Here is an example::
double d = double(x); // d now holds 2.0, a double value
The value ``x`` can be of any type. However, if ``x`` is not a number
-(like an ``int`` or ``long``), you will get strange results.
+(like an ``int`` or ``long long``), you will get strange results.
See the :ref:`double <lang-double>` reference for details about the
precision and limitations of ``double`` values on the Maple.
diff --git a/source/lang/cpp/enum.rst b/source/lang/cpp/enum.rst
index ba82383..b6409eb 100644
--- a/source/lang/cpp/enum.rst
+++ b/source/lang/cpp/enum.rst
@@ -18,8 +18,7 @@ which has values ``HOT``, ``COMFY``, and ``COLD``::
enum weather {HOT, COMFY, COLD};
Once you've defined this type, you can create variables of type
-``weather``, in the same way you would with an :ref:`int <lang-int>`
-or a :ref:`long <lang-long>`::
+``weather``, in the same way you would with an :ref:`int <lang-int>`::
// create a weather variable named theWeather, with value COMFY:
weather theWeather = COMFY;
diff --git a/source/lang/cpp/int.rst b/source/lang/cpp/int.rst
index ca75f75..3e96b69 100644
--- a/source/lang/cpp/int.rst
+++ b/source/lang/cpp/int.rst
@@ -24,6 +24,10 @@ arithmetic operations work mostly as you'd expect. There can be an
dealing with the :ref:`bitshift right operator (>>)
<lang-bitshift>`, however.
+.. _lang-long:
+
+The ``long`` type is a synonym for ``int``.
+
Here is an example of declaring an ``int`` variable named ``ledPin``,
then giving it value 13::
@@ -56,8 +60,8 @@ See Also
- :ref:`unsigned int <lang-unsignedint>`
- :ref:`char <lang-char>`
- :ref:`unsigned char <lang-unsignedchar>`
-- :ref:`long <lang-long>`
-- :ref:`unsigned long <lang-unsignedlong>`
+- :ref:`long long <lang-longlong>`
+- :ref:`unsigned long long <lang-unsignedlonglong>`
- :ref:`Integer Constants <lang-constants-integers>`
- :ref:`Variables <lang-variables>`
diff --git a/source/lang/cpp/keywords.rst b/source/lang/cpp/keywords.rst
index e3bc20d..f21cd0d 100644
--- a/source/lang/cpp/keywords.rst
+++ b/source/lang/cpp/keywords.rst
@@ -89,11 +89,11 @@ Types
The following keywords are used for built-in types.
- :ref:`bool <lang-booleanvariables>`
-- :ref:`lang-char`
-- :ref:`lang-double`
-- :ref:`lang-float`
-- :ref:`lang-int`
-- :ref:`lang-long`
+- :ref:`char <lang-char>`
+- :ref:`double <lang-double>`
+- :ref:`float <lang-float>`
+- :ref:`int <lang-int>`
+- :ref:`long <lang-long>`
- :ref:`short <lang-built-in-types-integral>`
- :ref:`void <lang-void>` (not really a type, but used in the absence
of one)
@@ -109,8 +109,7 @@ Qualifiers
variables; it has other uses not documented here.
- ``unsigned`` is used to specify an unsigned integral type.
- Examples: :ref:`lang-unsignedint`, :ref:`lang-unsignedchar`,
- :ref:`lang-unsignedlong`.
+ Examples: :ref:`lang-unsignedint`, :ref:`lang-unsignedchar`.
- :ref:`volatile <lang-volatile>` is useful when declaring variables
that may be modified by external interrupts.
diff --git a/source/lang/cpp/long.rst b/source/lang/cpp/long.rst
deleted file mode 100644
index d8498c0..0000000
--- a/source/lang/cpp/long.rst
+++ /dev/null
@@ -1,52 +0,0 @@
-.. highlight:: cpp
-
-.. _lang-long:
-
-``long``
-========
-
-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
-<lang-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). A ``long`` it is subject to the same :ref:`overflow issues
-<lang-variables-rollover>` as any numeric data type.
-
-Here's an example of declaring a long (see :ref:`integer constants
-<lang-constants-integers-u-l>` for an explanation of the "L" at the end of the
-number)::
-
- // 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
-<lang-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 <lang-arithmetic>` operations
-on ``long``\ s will take slightly longer than on ``int``\ s.
-
-See Also
---------
-
-- :ref:`char <lang-char>`
-- :ref:`unsigned char <lang-unsignedchar>`
-- :ref:`int <lang-int>`
-- :ref:`unsigned int <lang-unsignedint>`
-- :ref:`unsigned long <lang-unsignedlong>`
-- :ref:`Integer Constants <lang-constants-integers>`
-- :ref:`Variables <lang-variables>`
-
-.. include:: cc-attribution.txt
diff --git a/source/lang/cpp/longcast.rst b/source/lang/cpp/longcast.rst
index 2b92345..f588fc6 100644
--- a/source/lang/cpp/longcast.rst
+++ b/source/lang/cpp/longcast.rst
@@ -21,7 +21,7 @@ precision and limitations of ``long`` variables on the Maple.
See Also
--------
-- :ref:`long <lang-long>`
-
+- :ref:`long <lang-long>`
+- :ref:`long long <lang-longlong>`
.. include:: cc-attribution.txt
diff --git a/source/lang/cpp/longlong.rst b/source/lang/cpp/longlong.rst
new file mode 100644
index 0000000..0ba56ed
--- /dev/null
+++ b/source/lang/cpp/longlong.rst
@@ -0,0 +1,56 @@
+.. highlight:: cpp
+
+.. _lang-longlong:
+
+``long long``
+=============
+
+The ``long long`` data type stores extended size integer values. You
+can use a ``long long`` when your values are too large to fit into an
+:ref:`int <lang-int>`. A ``long 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 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). A ``long long`` it is subject to the same
+:ref:`overflow issues <lang-variables-rollover>` as any numeric data
+type.
+
+A synonym for the ``long long`` type is ``int64``.
+
+Here's an example of declaring a long long (see :ref:`integer
+constants <lang-constants-integers-u-l>` for an explanation of the
+"LL" at the end of the number)::
+
+ // Speed of light in nanometers per second (approximate).
+ long long c = 299792458000000000LL;
+
+The general syntax for declaring an ``long long`` variable named ``var``,
+then giving it value ``val``, looks like::
+
+ long long var = val;
+
+This is identical to the ``int`` syntax, with ``long long`` (or, at
+your option, ``int64``) replacing ``int``.
+
+Note that ``long long`` values will still :ref:`overflow
+<lang-int-overflow>`, just like ``int`` values, but their much larger
+range makes this less likely to happen.
+
+The downside to using a ``long long`` instead of an ``int`` (besides
+the extra storage) is that :ref:`arithmetic <lang-arithmetic>`
+operations on ``long long``\ s will take slightly longer than on
+``int``\ s.
+
+See Also
+--------
+
+- :ref:`char <lang-char>`
+- :ref:`unsigned char <lang-unsignedchar>`
+- :ref:`int <lang-int>`
+- :ref:`unsigned int <lang-unsignedint>`
+- :ref:`unsigned long long <lang-unsignedlonglong>`
+- :ref:`Integer Constants <lang-constants-integers>`
+- :ref:`Variables <lang-variables>`
+
+.. include:: cc-attribution.txt
diff --git a/source/lang/cpp/return.rst b/source/lang/cpp/return.rst
index 7b5039e..b4ef5fd 100644
--- a/source/lang/cpp/return.rst
+++ b/source/lang/cpp/return.rst
@@ -21,7 +21,7 @@ Syntax:
In the second case, ``value`` should have a type which is the same as
the return type of the function, or be convertible to it (like an
-``int`` to a ``long``, etc.; see :ref:`this note
+``int`` to a ``double``, etc.; see :ref:`this note
<lang-arithmetic-typeconversion>` for some references).
Examples:
diff --git a/source/lang/cpp/unsignedint.rst b/source/lang/cpp/unsignedint.rst
index f6311da..ad3e2f2 100644
--- a/source/lang/cpp/unsignedint.rst
+++ b/source/lang/cpp/unsignedint.rst
@@ -31,6 +31,10 @@ that an ``unsigned int`` will "underflow" at 0, and "overflow" at
x--; // x now contains 4,294,967,295; rolled over "left to right"
x++; // x now contains 0; rolled over "right to left"
+.. _lang-unsignedlong:
+
+The ``unsigned long`` type is a synonym for ``unsigned int``.
+
Here is an example of declaring an ``unsigned int`` variable named
``ledPin``, then giving it value 13::
@@ -47,8 +51,8 @@ See Also
- :ref:`int <lang-int>`
- :ref:`char <lang-char>`
- :ref:`unsigned char <lang-unsignedchar>`
-- :ref:`long <lang-long>`
-- :ref:`unsigned long <lang-unsignedlong>`
+- :ref:`long long <lang-longlong>`
+- :ref:`unsigned long long <lang-unsignedlonglong>`
- :ref:`Integer Constants <lang-constants-integers>`
- :ref:`Variables <lang-variables>`
diff --git a/source/lang/cpp/unsignedlong.rst b/source/lang/cpp/unsignedlong.rst
deleted file mode 100644
index 14a4fc3..0000000
--- a/source/lang/cpp/unsignedlong.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-.. highlight:: cpp
-
-.. _lang-unsignedlong:
-
-``unsigned long``
-=================
-
-An unsigned version of the :ref:`long <lang-long>` data type. An
-``unsigned long`` occupies 8 bytes of memory; it stores an integer
-from 0 to 2^64-1, which is approximately 1.8×10^19 (18 quintillion, or
-18 billion billion).
-
-Like an :ref:`unsigned int <lang-unsignedint>`, an ``unsigned long``
-won't store negative numbers; it is also subject to the same
-:ref:`overflow issues <lang-int-overflow>` as any integral data type.
-
-Here is an example of declaring an ``unsigned long`` variable named
-``c``, then giving it value 299,792,458,000,000,000 (see :ref:`integer
-constants <lang-constants-integers-u-l>` for an explanation of the "L"
-at the end of the number)::
-
- // Speed of light in nanometers per second (approximate).
- unsigned long c = 299792458000000000L;
-
-The general syntax for declaring an ``unsigned long`` variable named
-``var``, then giving it value ``val``, looks like::
-
- unsigned long var = val;
-
-See Also
---------
-
-- :ref:`long <lang-long>`
-- :ref:`int <lang-int>`
-- :ref:`unsigned <lang-unsignedint>`
-- :ref:`char <lang-char>`
-- :ref:`unsigned char <lang-unsignedchar>`
-- :ref:`Integer Constants <lang-constants-integers>`
-- :ref:`Variables <lang-variables>`
-
-.. include:: cc-attribution.txt
diff --git a/source/lang/cpp/unsignedlonglong.rst b/source/lang/cpp/unsignedlonglong.rst
new file mode 100644
index 0000000..910b7e4
--- /dev/null
+++ b/source/lang/cpp/unsignedlonglong.rst
@@ -0,0 +1,43 @@
+.. highlight:: cpp
+
+.. _lang-unsignedlonglong:
+
+``unsigned long long``
+======================
+
+An unsigned version of the :ref:`long long <lang-longlong>` data type.
+An ``unsigned long long`` occupies 8 bytes of memory; it stores an
+integer from 0 to 2^64-1, which is approximately 1.8×10^19 (18
+quintillion, or 18 billion billion).
+
+A synonym for the ``unsigned long long`` type is ``uint64``.
+
+Like an :ref:`unsigned int <lang-unsignedint>`, an ``unsigned long
+long`` won't store negative numbers; it is also subject to the same
+:ref:`overflow issues <lang-int-overflow>` as any integral data type.
+
+Here is an example of declaring an ``unsigned long long`` variable
+named ``c``, then giving it value 299,792,458,000,000,000 (see
+:ref:`integer constants <lang-constants-integers-u-l>` for an
+explanation of the "ULL" at the end of the number)::
+
+ // Speed of light in nanometers per second (approximate).
+ unsigned long long c = 299792458000000000ULL;
+
+The general syntax for declaring an ``unsigned long long`` variable named
+``var``, then giving it value ``val``, looks like::
+
+ unsigned long long var = val;
+
+See Also
+--------
+
+- :ref:`long long <lang-longlong>`
+- :ref:`int <lang-int>`
+- :ref:`unsigned <lang-unsignedint>`
+- :ref:`char <lang-char>`
+- :ref:`unsigned char <lang-unsignedchar>`
+- :ref:`Integer Constants <lang-constants-integers>`
+- :ref:`Variables <lang-variables>`
+
+.. include:: cc-attribution.txt
diff --git a/source/lang/cpp/variables.rst b/source/lang/cpp/variables.rst
index e6da0c9..336d5ab 100644
--- a/source/lang/cpp/variables.rst
+++ b/source/lang/cpp/variables.rst
@@ -44,7 +44,7 @@ Here are a few examples of declaring variables of different types::
int lightSensVal;
char currentLetter;
- unsigned long speedOfLight = 186000UL;
+ unsigned long long speedOfLight = 186000ULL;
char errorMessage = {"choose another option"}; // see string
Naming Variables
diff --git a/source/language.rst b/source/language.rst
index 018eb8c..2ebe03c 100644
--- a/source/language.rst
+++ b/source/language.rst
@@ -102,59 +102,59 @@ A more exhaustive index is available at the :ref:`language-index`.
| |* :ref:`unsigned int <lang-unsignedint>` | |
|* :ref:`#include <lang-include>` | (4 bytes) |* :ref:`micros() <lang-micros>` |
| | | |
-| |* :ref:`long <lang-long>` (8 bytes) |* :ref:`delay() <lang-delay>` |
-|**Arithmetic Operators** | | |
-| |* :ref:`unsigned long <lang-unsignedlong>` |* :ref:`delayMicroseconds() |
-|* :ref:`= <lang-assignment>` | (8 bytes) | <lang-delaymicroseconds>` |
-| (assignment operator) | | |
-| |* :ref:`float <lang-float>` (4 bytes) | |
-|* :ref:`+ <lang-arithmetic>` (addition) | |**Math** |
-| |* :ref:`double <lang-double>` (8 bytes) | |
-|* :ref:`- <lang-arithmetic>` | |* :ref:`min() <lang-min>` |
-| (subtraction) |* :ref:`Strings <lang-string>` | |
+| |* ``long`` (4 bytes), synonym for :ref:`int |* :ref:`delay() <lang-delay>` |
+|**Arithmetic Operators** | <lang-int>` | |
+| | |* :ref:`delayMicroseconds() |
+|* :ref:`= <lang-assignment>` |* ``unsigned long`` (4 bytes), synonym for | <lang-delaymicroseconds>` |
+| (assignment operator) | :ref:`unsigned int <lang-unsignedint>` | |
+| | | |
+|* :ref:`+ <lang-arithmetic>` (addition) |* :ref:`long long <lang-longlong>` (8 bytes) |**Math** |
+| | | |
+|* :ref:`- <lang-arithmetic>` |* :ref:`unsigned long |* :ref:`min() <lang-min>` |
+| (subtraction) | long <lang-unsignedlonglong>` (8 bytes) | |
| | |* :ref:`max() <lang-max>` |
-|* :ref:`* <lang-arithmetic>` |* :ref:`Arrays <lang-array>` | |
+|* :ref:`* <lang-arithmetic>` |* :ref:`float <lang-float>` (4 bytes) | |
| (multiplication) | |* :ref:`abs() <lang-abs>` |
-| |* :ref:`enum <lang-enum>` | |
+| |* :ref:`double <lang-double>` (8 bytes) | |
|* :ref:`/ <lang-arithmetic>` (division) | |* :ref:`constrain() <lang-constrain>` |
-| |* :ref:`Numeric types <lang-built-in-types>` | |
+| |* :ref:`strings <lang-string>` | |
|* :ref:`% <lang-modulo>` (modulo) | |* :ref:`map() <lang-map>` |
-| |**Conversion** | |
+| |* :ref:`arrays <lang-array>` | |
| | |* :ref:`pow() <lang-pow>` |
-|**Comparison Operators** |* :ref:`char() <lang-charcast>` | |
+|**Comparison Operators** |* :ref:`enum <lang-enum>` | |
| | |* :ref:`sqrt() <lang-sqrt>` |
-|* :ref:`== <lang-comparison>` (equal to) |* :ref:`byte() <lang-bytecast>` | |
+|* :ref:`== <lang-comparison>` (equal to) |* :ref:`numeric types <lang-built-in-types>` | |
| | | |
-|* :ref:`\!= <lang-comparison>` |* :ref:`int() <lang-intcast>` |**Trigonometry** |
+|* :ref:`\!= <lang-comparison>` |**Conversion** |**Trigonometry** |
| (not equal to) | | |
-| |* :ref:`long() <lang-longcast>` |* :ref:`sin() <lang-sin>` |
+| |* :ref:`char() <lang-charcast>` |* :ref:`sin() <lang-sin>` |
|* :ref:`< <lang-comparison>` (less than) | | |
-| |* :ref:`float() <lang-floatcast>` |* :ref:`cos() <lang-cos>` |
+| |* :ref:`byte() <lang-bytecast>` |* :ref:`cos() <lang-cos>` |
|* :ref:`> <lang-comparison>` | | |
-| (greater than) |* :ref:`double() <lang-doublecast>` |* :ref:`tan() <lang-tan>` |
+| (greater than) |* :ref:`int() <lang-intcast>` |* :ref:`tan() <lang-tan>` |
| | | |
-|* :ref:`<= <lang-comparison>` | | |
-| (less than or equal to) |**Variable Scope & Qualifiers** |**Random Numbers** |
-| | | |
-|* :ref:`>= <lang-comparison>` |* :ref:`variables <lang-variables>`, |* :ref:`randomSeed() <lang-randomseed>` |
-| (greater than or equal to) | :ref:`scope <lang-variables-scope>` | |
+|* :ref:`<= <lang-comparison>` |* :ref:`long() <lang-longcast>` | |
+| (less than or equal to) | |**Random Numbers** |
+| |* :ref:`float() <lang-floatcast>` | |
+|* :ref:`>= <lang-comparison>` | |* :ref:`randomSeed() <lang-randomseed>` |
+| (greater than or equal to) |* :ref:`double() <lang-doublecast>` | |
| | |* :ref:`random() <lang-random>` |
-| |* :ref:`static <lang-static>` | |
-|**Boolean Operators** | | |
-| |* :ref:`volatile <lang-volatile>` |**Bits and Bytes** |
-|* :ref:`&& <lang-boolean-and>` (and) | | |
-| |* :ref:`const <lang-const>` |* :ref:`lowByte() <lang-lowbyte>` |
-|* :ref:`|| <lang-boolean-or>` (or) | | |
-| | |* :ref:`highByte() <lang-highbyte>` is |
-|* :ref:`\! <lang-boolean-not>` (not) |**Utilities** | provided, though its use is discouraged. |
| | | |
-| |* :ref:`sizeof() <lang-sizeof>` |* :ref:`bitRead() <lang-bitread>` |
-|**Pointer Operators** | | |
+|**Boolean Operators** |**Variable Scope & Qualifiers** | |
+| | |**Bits and Bytes** |
+|* :ref:`&& <lang-boolean-and>` (and) |* :ref:`variables <lang-variables>`, | |
+| | :ref:`scope <lang-variables-scope>` |* :ref:`lowByte() <lang-lowbyte>` |
+|* :ref:`|| <lang-boolean-or>` (or) | | |
+| |* :ref:`static <lang-static>` |* :ref:`highByte() <lang-highbyte>` is |
+|* :ref:`\! <lang-boolean-not>` (not) | | provided, though its use is discouraged. |
+| |* :ref:`volatile <lang-volatile>` | |
+| | |* :ref:`bitRead() <lang-bitread>` |
+|**Pointer Operators** |* :ref:`const <lang-const>` | |
| | |* :ref:`bitWrite() <lang-bitwrite>` |
|* :ref:`* dereference operator | | |
-| <lang-pointer>` | |* :ref:`bitSet() <lang-bitset>` |
+| <lang-pointer>` |**Utilities** |* :ref:`bitSet() <lang-bitset>` |
| | | |
-|* :ref:`& reference operator | |* :ref:`bitClear() <lang-bitclear>` |
+|* :ref:`& reference operator |* :ref:`sizeof() <lang-sizeof>` |* :ref:`bitClear() <lang-bitclear>` |
| <lang-pointer>` | | |
| | |* :ref:`bit() <lang-bit>` |
| | | |