HTBasic Help
×
Menu
Index

Numeric Constant

 
A constant is an entity with a fixed value. There are three types of numeric constants: integer, long and real. An integer constant is a whole number not specified with a decimal point, ".", nor with scientific notation, which falls in the range -32,768 to 32,767. Integer constants can be expressed in decimal, octal (base 8) or hexadecimal (base 16). An octal constant must begin with the characters "&O" or simply "&". A hexadecimal constant must begin with the characters "&H. A long constant is in all ways identical to an integer constant, except that it can have a range of -2,147,483,648 to 2,147,483,647. A real constant is specified with a decimal point or scientific notation, or is outside the integer range. Some integer constants are "1", "-20000", "&H7FFF" and "&O377. Some real constants are "-1.0", "1E+10" and "6000000000".