def DF(self):
        """Compute the discount factor of two values"""
        
        if self.r_1<0 or self.r_2 < 0 or self.n<0:
            raise MinusSignError,\
              "\n<Rates values and period number should be positive "
        
        try:
            discount_factor_1 = "%2.3f" % m.pow((1+self.r_1),-self.n)
            discount_factor_2 = "%2.3f" % m.pow((1+self.r_2),-self.n)
        
            return (discount_factor_1,discount_factor_2)

        #DF raises Negative number error
        except MinusSignError,exception:
            print exception
Compute the discount factor of two values
recipes/Python/576683_IRRVersusNPV_26/recipe-576683.py