diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-12-03 20:18:00 -0500 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-12-03 20:18:00 -0500 |
commit | 210f3d2b1555bae87c9de27ea145e16d3bddb0f8 (patch) | |
tree | 5e409fff948c9a1847d08e5ec34f905ea2212956 /source/lang/compoundarithmetic.rst | |
parent | 11573d0fca18ef2ccd965ab67d419afd48b7cef2 (diff) | |
download | librambutan-210f3d2b1555bae87c9de27ea145e16d3bddb0f8.tar.gz librambutan-210f3d2b1555bae87c9de27ea145e16d3bddb0f8.zip |
cleaning up previous commits.
note that addition of new files under docs/source/lang/api and
docs/source/lang/cpp which were just copies of files in
docs/source/lang/ imply that change history is lost to git.
Diffstat (limited to 'source/lang/compoundarithmetic.rst')
-rw-r--r-- | source/lang/compoundarithmetic.rst | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/source/lang/compoundarithmetic.rst b/source/lang/compoundarithmetic.rst deleted file mode 100644 index 420f1db..0000000 --- a/source/lang/compoundarithmetic.rst +++ /dev/null @@ -1,44 +0,0 @@ -.. highlight:: cpp - -.. _lang-compoundarithmetic: - -Compound Arithmetic Operators (``+=`` , ``-=``, ``*=``, ``/=``) -=============================================================== - -These oparators perform a mathematical operation on a variable with -another constant or variable. These operators are just a convenient -shorthand:: - - x += y; // equivalent to the expression x = x + y; - x -= y; // equivalent to the expression x = x - y; - x *= y; // equivalent to the expression x = x * y; - x /= y; // equivalent to the expression x = x / y; - -Here is an example:: - - int x = 2; - int y = 10; - - x += 4; // x now contains 6 - x -= 3; // x now contains 3 - x *= y; // x now contains 30 - x /= 2; // x now contains 15 - x += max(20, 6); // x now contains 35 - x -= sq(5); // x now contains 15 - -Parameters ----------- - -**x**: a numeric variable - -**y**: a numeric variable, number constant, or any other expression -that evaluates to a number (e.g. call to a function that returns a -number). - -See Also --------- - -- :ref:`Arithmetic operators <lang-arithmetic>` - - -.. include:: cc-attribution.txt |