1.#INF - positive infinity. You will get it when you divide the positive float by zero (if you divide the float itself by zero, then the result will be "not a number").
On the other hand, if you divide the integer by zero, the program crashes.
Cause of emergencies float fZero = 2 / nQuota; consists in the fact that both operands of the operator / are integers; therefore, division is performed by integers. It doesnโt matter that you then save the result in a float; C ++ has no concept of target input.
Why a positive infinity other than a whole is the smallest integer, I have no idea.
fredoverflow
source share