So, for example, 12.12345 can be saved as a float, but 12.123456789 cannot be saved as afloat. The data type should never be used for precise values, such as currency.įloat data type in Java stores a decimal value with 6-7 total digits of precision. The double data type is normally the default choice for decimal values. Always we need to remember that data type should never be used for precise values, such as currency. A float is mainly used to save memory in large arrays of floating-point numbers.
0 Comments
Leave a Reply. |