Floating-point Literals
A floating-point literal has an integer part, a decimal point,
a fractional part, and an exponent part. You can represent
floating point literals either in decimal form or exponential form.
While representing using decimal form, you must include the decimal
point, the exponent, or both and while representing using exponential
form, you must include the integer part, the fractional part, or both.
The signed exponent is introduced by e or E.
Here are some examples of floating-point literals:
3.14159 // Legal
314159E-5L // Legal
510E // Illegal: incomplete exponent
210f // Illegal: no decimal or exponent
.e55 // Illegal: missing integer or fraction
No comments:
Post a Comment