Inspectopedia
 
2024.3

Cast to 'float' can be 'float' literal

Warning
New
Last modified: 03 December 2024

Reports double literal expressions that are immediately cast to float.

Such literal expressions can be replaced with equivalent float literals.

Example:

float f = (float)1.1;

After the quick-fix is applied:

float f = 1.1f;