Floating-point numbers can be represented in a number of ways. The following are all legitimate floating-point numbers :
Floating-point literals have several parts , which appear in the following order as shown in Table 3.9. Table 3.9. Floating-Point Literal Requirements
The following representations illustrate the ways you can specify a floating-point literal that is consistent with the requirements in Table 3.9:
The following restrictions apply to floating-point literals:
Troubleshooting Tip If you have trouble assigning floating-point literals to variables of type float , see "Floating-Point Literal Loss of Precision Error," in the "Troubleshooting" section at the end of this chapter. |