Skip to content

Commit 688129a

Browse files
committed
Some clarifications on literals.
1 parent f985913 commit 688129a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/types/value-types.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,14 +437,16 @@ an error. You can prepend (for integer types) or append (for bytesNN types) zero
437437
Rational and Integer Literals
438438
-----------------------------
439439

440-
Integer literals are formed from a sequence of numbers in the range 0-9.
440+
Integer literals are formed from a sequence of digits in the range 0-9.
441441
They are interpreted as decimals. For example, ``69`` means sixty nine.
442442
Octal literals do not exist in Solidity and leading zeros are invalid.
443443

444-
Decimal fraction literals are formed by a ``.`` with at least one number on
444+
Decimal fractional literals are formed by a ``.`` with at least one number on
445445
one side. Examples include ``1.``, ``.1`` and ``1.3``.
446446

447-
Scientific notation is also supported, where the base can have fractions and the exponent cannot.
447+
Scientific notation in the form of ``2e10`` is also supported, where the
448+
mantissa can be fractional but the eponent has to be integer.
449+
The literal ``MeE`` is equivalent to ``M * 10**E``.
448450
Examples include ``2e10``, ``-2e10``, ``2e-10``, ``2.5e1``.
449451

450452
Underscores can be used to separate the digits of a numeric literal to aid readability.

0 commit comments

Comments
 (0)