How R performs the operations like Inf + Inf, Inf * Inf, Inf - Inf and Inf / Inf?
Inf is a reserved word in R, so it is handled at interpreter level. That is, similar to FALSE &amp; TRUE $\rightarrow$ FALSE and FALSE | TRUE $\rightarrow$ TRUE, when interpreter is faced with Inf ? Inf, it decides what to do based on the operation ?. You can think of a set of if-then rules under the hood that resolve the expression to Inf for + and *, and to NaN for - and /, no complicated inference is involved.