import math
if n < 0:
raise ValueError("n must be >= 0")
if math.floor(n) != n:
raise ValueError("n must be exact integer")
if n+1 == n: # catch a value like 1e300
raise OverflowError("n too large")
result =1;
factor =2;
while factor <=n:
result *= factor
factor += 1
return result
This is a factorial function. I don't understand "if n+1 == n:", then it indicates a 'too large integer' exception. Why is it that?