Data Type | Description | Memory |
float | -3.4E38 to +3.4E38 | 4 bytes in memory |
double | -1.7E308 to +1.7E308 | 8 bytes in memory |
Examples of float literals include the following:
2elf 8.f .5f 0f 3.14f 9.0001e+12f
Here are examples of double literals.
2el 8. .5 0.0D 3.14 9e-9d 7e123D
2.10.Float Point Data Type | ||||
2.10.1. | Floating-Point Data Types: memory and length | |||
2.10.2. | Write Floating-Point Literals with an exponent | |||
2.10.3. | Floating-Point Calculations | |||
2.10.4. | Using ++ and -- with floating-point variables | |||
2.10.5. | Applying the modulus operator, %, to floating-point values |