Numeric constant: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(Created page with "The "num-constant" parameter represents a number consisting mainly of the digits 0-9; other optional elements are a decimal point (.), a minus sign (-) to indicate a negative ...")
 
No edit summary
Line 23: Line 23:
:-8.634E+1<br>
:-8.634E+1<br>
:1E+4
:1E+4
<noinclude>
[[Category:Definitions]]
</noinclude>

Revision as of 01:07, 8 February 2013

The "num-constant" parameter represents a number consisting mainly of the digits 0-9; other optional elements are a decimal point (.), a minus sign (-) to indicate a negative number, and a plus sign (+) to indicate a positive number (unsigned numbers are assumed to be positive). If a sign is specified, it must precede the digits. Spaces are not allowed in a numeric constant.

Integers, fixed-point numbers and floating point numbers (numbers in exponential notation) are three types of numeric constants. See the following examples:

Number

44
+15.38
-86.34
10,000
Integer

44
n/a
n/a
10000
Fixed Point

44
+15.38
-86.34
10000
Exponential

4.4E+1
1.538E+1
-8.634E+1
1E+4