Skip to content

Commit

Permalink
Update mathematical-operations.rst
Browse files Browse the repository at this point in the history
I added a note that the updating-operators can change the type.  This is implicit in the current manual, but it nonetheless threw me for a loop the first time it happened to me (this is different, e.g., from C++), so I thought it should be made explicit.
  • Loading branch information
StephenVavasis authored and jiahao committed Oct 28, 2014
1 parent 75cff03 commit e244107
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/manual/mathematical-operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ are::
+= -= *= /= \= %= ^= &= |= $= >>>= >>= <<=


It should be noted that updating operators can change the type of the variable. For example, after the first
statement below, ``x`` is of type ``Uint32``, but after the second statement, it is of type ``Int``::

x = 0x00000001
x *= 2
This is in consistent with the equivalence between ``x *= 2`` and ``x = x * 2``: any assignment statement to
a plain variable may change its type.

.. _man-numeric-comparisons:

Numeric Comparisons
Expand Down

0 comments on commit e244107

Please sign in to comment.