Added Infinity check in calculation results (e.g. division by zero)