Inspectopedia
 
2024.3

Confusing floating-point literal

Warning
New
Last modified: 03 December 2024

Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point.

Such literals may be confusing, and violate several coding standards.

Example:

double d = .03;

After the quick-fix is applied:

double d = 0.03;

Use the Ignore floating point literals in scientific notation option to ignore floating point numbers in scientific notation.