Types of Numeric Literals
The Jade compiler treats a numeric literal as an
If the literal does not contain a decimal point, it is treated as an Integer, Integer64, or Decimal primitive type, depending on the value. The following table lists the ranges for positive integer values.
Range | Implicit Type of Literal |
---|---|
0 through 2,147,483,647 (Max_Integer) | Integer |
2,147,483,648 through 9,223,372,036,854,775,807 (Max_Integer64) | Integer64 |
Greater than 9,223,372,036,854,775,807 but less than 10^24 | Decimal |
The ranges for negative integer values mirror those for positive integer values, as listed in the following table.
Range | Implicit Type of Literal |
---|---|
-2,147,483,647 through 0 | Integer |
-9,223,372,036,854,775,807 through -2,147,483,648 | Integer64 |
Less than -9,223,372,036,854,775,807 but greater than -10^24 | Decimal |
If the literal contains a decimal point, it is treated as a Decimal or Real primitive type, depending on the number of significant digits, as listed in the following table.
Number of Significant Digits | Implicit Type of Literal |
---|---|
1 through 15 | Real |
Greater than 15 | Decimal |