diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-10-20 06:46:52 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-10-20 06:46:52 -0400 |
commit | 22ff1db8a76c7047b61a424ae1fa5f43697fcb34 (patch) | |
tree | bf722c8a5a6bd40e0b33fc4a425e0e5b8b9f4216 /docs/source/arduino/incrementcompound.rst | |
parent | bac6548fe90b0721e191d68df2677beb4b15f60a (diff) | |
download | librambutan-22ff1db8a76c7047b61a424ae1fa5f43697fcb34.tar.gz librambutan-22ff1db8a76c7047b61a424ae1fa5f43697fcb34.zip |
initial check-in of arduino docs in RST format (converted using wget+pandoc)
Diffstat (limited to 'docs/source/arduino/incrementcompound.rst')
-rw-r--r-- | docs/source/arduino/incrementcompound.rst | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/docs/source/arduino/incrementcompound.rst b/docs/source/arduino/incrementcompound.rst new file mode 100644 index 0000000..0005fbc --- /dev/null +++ b/docs/source/arduino/incrementcompound.rst @@ -0,0 +1,49 @@ +.. _arduino-incrementcompound: + ++= , -= , \*= , /= +================== + +Description +----------- + +Perform a mathematical operation on a variable with another +constant or variable. The += (et al) operators are just a +convenient shorthand for the expanded syntax, listed below. + + + +Syntax +------ + +:: + + 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; + + + +Parameters +---------- + +x: any variable type + + + +y: any variable type or constant + + + +Examples +-------- + +:: + + x = 2; + x += 4; // x now contains 6 + x -= 3; // x now contains 3 + x *= 10; // x now contains 30 + x /= 2; // x now contains 15 + + |