Floating-point literals 浮点型字面量

A floating-point literal is a decimal representation of a floating-point constant. It has an integer part, a decimal point, a fractional part, and an exponent part. The integer and fractional part comprise decimal digits; the exponent part is an e or E followed by an optionally signed decimal exponent. One of the integer part or the fractional part may be elided; one of the decimal point or the exponent may be elided.

浮点数字面量使用小数标示浮点数常数.它有整数部分,小数点、分数部分,指数部分.整数和分数部分组成十进制数字。 指数部分是一个e或E跟在一个可选的符号十进制shi ji d s fa g d d f。 整数部分或小数部分可以被省略(如:.25 或 2. )。小数点或指数可以被省略(如:2 或 1)。

float_lit = decimals "." [ decimals ] [ exponent ] |
            decimals exponent |
            "." decimals [ exponent ] .
decimals  = decimal_digit { decimal_digit } .
exponent  = ( "e" | "E" ) [ "+" | "-" ] decimals .
0.
72.40
072.40  // == 72.40
2.71828
1.e+0
6.67428e-11
1E6
.25
.12345E+5