ReSharper 2026.1 Help

Code inspection: Possible loss of fraction

This inspection reports integer division whose result is only converted to float, double, or decimal afterwards. In that case, the fractional part is already lost before the conversion happens.

Example

int total = 1; int count = 2; float average = total / count;

Here total / count is evaluated as integer division, so the result is 0, not 0.5.

How to fix it

There is no dedicated quick-fix for this inspection. The usual fix is to make at least one operand non-integer before the division.

int total = 1; int count = 2; float average = (float)total / count;
01 April 2026