Skip to content

Numeric constant

Øyvind Kallstad edited this page Sep 14, 2017 · 2 revisions

Real numbers (float)

Real numbers are numbers that conform to one of the following forms:

  • [+|-] digits . digits [e [(+|-)] digits] [(d|l)] [(kb|mb|gb|tb|pb)]
  • [(+|-)] . digits [e [(+|-)] digits] [(d|l)] [(kb|mb|gb|tb|pb)]
  • [(+|-)] digits . [e [(+|-)] digits] [(d|l)] [(kb|mb|gb|tb|pb)]
  • [(+|-)] digits [e [(+|-)] digits] [(d|l)] [(kb|mb|gb|tb|pb)]
Example
-999e-10dmb
+6.e-6lkb
+.6
-.9e+5dmb
.6tb
+4.9e+5dmb
4.5
-9.9
+7.4

Scopes

The following scopes are assigned to real numbers:

  • constant.numeric.real

Integers

Integers are numbers that conform to the following form:

  • [(+|-)] digits [(d|l)] [(kb|mb|gb|tb|pb)]
Example
7
-100
+73kb

Scopes

The following scopes are assigned to real numbers:

  • constant.numeric.integer

Hexadecimal numbers

Hexadecimal numbers are numbers that conform to the following form:

  • 0x 0-f [l] [kb|mb|gb|tb|pb]
Example
0x9
0x25l

Scopes

The following scopes are assigned to real numbers:

  • constant.numeric.hex