import math


def CO2_Calc(PO2, T):
    """
    Calculate CO2.

    :param PO2: partial pressure [atm]
    :type PO2 : float
    :param T: cell operation temperature [K]
    :type T : float
    :return: CO2 [mol/cm^3] as float
    """
    try:
        result = PO2 / (5.08 * (10 ** 6) * math.exp(-498 / T))
        return result
    except (TypeError, ZeroDivisionError, OverflowError, ValueError):
        print(
            "[Error] CO2 Calculation Failed (PO2:%s, T:%s)" %
            (str(PO2), str(T)))