Inspectopedia Help

Confusing floating-point literal

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.

Inspection options

Option

Type

Default

Ignore floating-point literals in scientific notation

Checkbox

false

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023