numeric digits 5 say 54321*54321
2950800000
in the long form. Because this is misleading, the result is expressed as 2.9508E+9
instead.
>>-+------------+--+----------------------+--+-digits--------+----------> +-whitespace-+ +-sign--+------------+-+ +-digits.digits-+ +-whitespace-+ +-.digits-------+ +-digits.-------+ >--+---------------------+--+------------+------------------------->< +-E--+------+--digits-+ +-whitespace-+ +-sign-+
E
represents a power of ten that is to be applied to the number. The E
can be in uppercase or lowercase.
0E123
(0 times 10 raised to the power of 123) and 1E342
(1 times 10 raised to the power of 342). Also, a comparison such as 0E123=0E567
gives a true result of 1
(0 is equal to 0). To prevent problems when comparing nonnumeric strings, use the strict comparison operators.
Example 10.5. Exponential notation
12E7 = 120000000 /* Displays "1" */ 12E-5 = 0.00012 /* Displays "1" */ -12e4 = -120000 /* Displays "1" */ 0e123 = 0e456 /* Displays "1" */ 0e123 == 0e456 /* Displays "0" */
E
to improve readability. If the exponent is 0
, the exponential part is omitted--that is, an exponential part of E+0
is not generated.
1
through 999
. You can control whether scientific or engineering notation is used with the following instruction:
+-SCIENTIFIC------------+ >>-NUMERIC FORM--+-----------------------+--;------------------>< +-ENGINEERING-----------+ +-+-------+--expression-+ +-VALUE-+
Example 10.6. Scientific notation
/* after the instruction */ Numeric form scientific 123.45 * 1e11 -> 1.2345E+13 /* after the instruction */ Numeric form engineering 123.45 * 1e11 -> 12.345E+12