mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update documentation.
This commit is contained in:
parent
932e7887bd
commit
f7e219ed91
@ -51,18 +51,18 @@ Integers
|
||||
Operators:
|
||||
|
||||
* Comparisons: ``<=``, ``<``, ``==``, ``!=``, ``>=``, ``>`` (evaluate to ``bool``)
|
||||
* Bit operators: ``&``, ``|``, ``^`` (bitwise exclusive or), ``~`` (bitwise negation), ``<<`` (left shift), ``>>`` (right shift)
|
||||
* Arithmetic operators: ``+``, ``-``, unary ``-``, unary ``+``, ``*``, ``/``, ``%`` (remainder), ``**`` (exponentiation)
|
||||
* Bit operators: ``&``, ``|``, ``^`` (bitwise exclusive or), ``~`` (bitwise negation)
|
||||
* Arithmetic operators: ``+``, ``-``, unary ``-``, unary ``+``, ``*``, ``/``, ``%`` (remainder), ``**`` (exponentiation), ``<<`` (left shift), ``>>`` (right shift)
|
||||
|
||||
Division always truncates (it just maps to the DIV opcode of the EVM), but it does not truncate if both
|
||||
operators are :ref:`literals<rational_literals>` (or literal expressions).
|
||||
|
||||
Division by zero and modulus with zero throws an exception.
|
||||
Division by zero and modulus with zero throws a runtime exception.
|
||||
|
||||
The result of a shift operation is the type of the left operand. The
|
||||
expression ``x << y`` is equivalent to ``x * 2**y`` and ``x >> y`` is
|
||||
equivalent to ``x / 2**y``. This means that shifting negative numbers
|
||||
sign extends. Shifting by a negative amount throws an exception.
|
||||
sign extends. Shifting by a negative amount throws a runtime exception.
|
||||
|
||||
.. index:: address, balance, send, call, callcode, delegatecall
|
||||
|
||||
@ -144,9 +144,9 @@ Operators:
|
||||
* Bit operators: ``&``, ``|``, ``^`` (bitwise exclusive or), ``~`` (bitwise negation), ``<<`` (left shift), ``>>`` (right shift)
|
||||
* Index access: If ``x`` is of type ``bytesI``, then ``x[k]`` for ``0 <= k < I`` returns the ``k`` th byte (read-only).
|
||||
|
||||
The shifting operator wors with any integer type as right operand (bit will
|
||||
return the type of the left operand). Shifting by a negative amount will cause
|
||||
a runtime exception.
|
||||
The shifting operator works with any integer type as right operand (but will
|
||||
return the type of the left operand), which denotes the number of bits to shift by.
|
||||
Shifting by a negative amount will cause a runtime exception.
|
||||
|
||||
Members:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user