diff --git a/doc/manual/mathematical-operations.rst b/doc/manual/mathematical-operations.rst index 2984a1df82030..3b6c307b1fb75 100644 --- a/doc/manual/mathematical-operations.rst +++ b/doc/manual/mathematical-operations.rst @@ -122,17 +122,21 @@ 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. - +.. note:: + Updating operators may change the type of the variable, since any assignment + statement to a plain variable may change its type. + + .. doctest:: + + julia> x = 0x01; typeof(x) + Uint8 + + julia> x *= 2 #Same as x = x * 2 + 2 + + julia> isa(x, Int) + true + .. _man-numeric-comparisons: Numeric Comparisons