BASIC-80

Language Elements

Octal Integer Constants

Octal integer constants are identified by the suffix Q following the numeric value. The numerals 0-7 are used as octal digits. Each digit represents 3 bits of data. Some octal iQteger constants are:

OctalDecimal

Equivalent

7720506

444402340

7Q7

Single-Precision Floating-Point Constants

Single-precision floating-point constants are identified by the suffix ! following the numeric value, by the letter E identifying the exponent in scientific notation, or by the presence of a decimal point in a number having seven or fewer digits. Floating- point numbers in the range ± 1.2 x 10-38to ± 3.4 x 1038 are represented with seven digits of accuracy.

Each single-precision floating-point constant requires four bytes of memory. Because this is half the storage required by double-precision floating-point con- stants, and because single-precision arithmetic is quicker than double-precision arithmetic, it's a good idea to use single-precision wherever possible for floating- point operators.

Some single-precision floating-point constants are:

142!

-1.414 6.259371 E-09

Double-Precision Floating-Point Constants

Double-precision floating-point constants are identified by the suffix # following the numeric value, by the letter D identifying the exponent in scientific notation, or by having more than seven digits. Floating-point numbers in the range ± 2.2 x 10-308to

±1.8 x 10308 are represented with 16 digits of accuracy.

Each double-precision floating-point constant requires eight bytes of memory. Some double-precision floating-point constants are:

-2.001317921012 11235813213455 24.2#

Variables

Numeric variables represent numeric values that can change during program execu- tion. These can be of three types, like numeric constants: integer, single-precision floating-point, or double-precision floating-point. Numeric variables are repre- sented by one or two characters followed by an optional type identifier suffix. The first character must be a letter; the second, which is optional, may be any alphanumeric character. If the variable name contains more than two characters besides a type identifier suffix, the rest of the variable name characters are ignored. No words used as BASIC-80 instruction words may be used within variable names.

2-7

Page 17
Image 17
Intel 9800758-02 manual Octal Integer Constants, Single-Precision Floating-Point Constants