mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1455 from ethereum/doc-number-literal-format
docs: describe the form of number literals
This commit is contained in:
commit
0cd6394735
@ -169,6 +169,14 @@ Fixed Point Numbers
|
|||||||
Rational and Integer Literals
|
Rational and Integer Literals
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
Integer literals are formed from a sequence of numbers in the range 0-9.
|
||||||
|
They are interpreted as decimals. For example, ``69`` means sixty nine.
|
||||||
|
Octal literals do not exist in Solidity and leading zeros are ignored.
|
||||||
|
For example, ``0100`` means one hundred.
|
||||||
|
|
||||||
|
Decimal literals are formed by a ``.`` with at least one number on
|
||||||
|
one side. Examples include ``1.``, ``.1`` and ``1.3``.
|
||||||
|
|
||||||
Number literal expressions retain arbitrary precision until they are converted to a non-literal type (i.e. by
|
Number literal expressions retain arbitrary precision until they are converted to a non-literal type (i.e. by
|
||||||
using them together with a non-literal expression).
|
using them together with a non-literal expression).
|
||||||
This means that computations do not overflow and divisions do not truncate
|
This means that computations do not overflow and divisions do not truncate
|
||||||
|
Loading…
Reference in New Issue
Block a user