I'd suspect that the first part is a mistaken attempt to ensure nValue does not exceed nLimit. It possibly should be
if (nValue + 0.01 > nLimit)
nValue = nLimit - 0.01;
In other words, if nValue is closer than 0.01 to the limit make it 0.01 less than the limit
To explain how the second part works, it involves dividing a floating point number by the integer part of the number. If the number is an integer then the result will be 1
e.g.
23.00 / 23 = 1 - It's an integer
23.05 / 23 = 1.002 - It's not an integer
Adding 1 to each side is (as ufukgun noticed) to prevent devide by zero, but the devision is redundant as you could simply compare the float with the int
if (nValue == (int)nValue)