Product SiteDocumentation Site

1.10.4.5. Numbers

Numbers are character strings consisting of one or more decimal digits, with an optional prefix of a plus (+) or minus (-) sign, and optionally including a single period (.) that represents a decimal point. A number can also have a power of 10 suffixed in conventional exponential notation: an E (uppercase or lowercase), followed optionally by a plus or minus sign, then followed by one or more decimal digits defining the power of 10. Whenever a character string is used as a number, rounding can occur to a precision specified by the NUMERIC DIGITS instruction (the default is nine digits). See Chapter 10, Numbers and Arithmetic for a full definition of numbers.
Numbers can have leading whitespace (before and after the sign) and trailing whitespace. Whitespace characters cannot be embedded among the digits of a number or in the exponential part. Note that a symbol or a literal string can be a number. A number cannot be the name of a variable.
These are valid numbers:

Example 1.12. Valid numbers

12
"-17.9"
127.0650
73e+128
" + 7.9E5 "

You can specify numbers with or without quotation marks around them. Note that the sequence -17.9 (without quotation marks) in an expression is not simply a number. It is a minus operator (which can be prefix minus if no term is to the left of it) followed by a positive number. The result of the operation is a number, which might be rounded or reformatted into exponential form depending on the size of the number and the current NUMERIC DIGITS setting.
A whole number is a number that has a no decimal part and that the language processor would not usually express in exponential notation. That is, it has no more digits before the decimal point than the current setting of NUMERIC DIGITS.
Implementation maximum: The exponent of a number expressed in exponential notation can have up to nine digits.