Add stricter hex underscore rules

This commit is contained in:
Balajiganapathi S
2018-08-08 12:05:51 +02:00
committed by Christian Parpart
parent 0000bfc604
commit 09a36cba02
7 changed files with 86 additions and 20 deletions
+2 -2
View File
@@ -284,8 +284,8 @@ one side. Examples include ``1.``, ``.1`` and ``1.3``.
Scientific notation is also supported, where the base can have fractions, while the exponent cannot.
Examples include ``2e10``, ``-2e10``, ``2e-10``, ``2.5e1``.
Underscores can be used to separate digits of a numeric literal to aid readability.
For example, ``123_000``, ``0x2eff_abde``, ``1_233e34_89`` are all valid. Underscores are only allowed between two digits.
Underscores can be used to separate the digits of a numeric literal to aid readability.
For example, ``123_000``, ``0x2eff_abde``, ``1233_e348_9a`` are all valid. Underscores are only allowed between two digits. For hex literals, underscores are only allowed to separate groups of 4 hex digits.
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).