def maclaurin_binomial(value,m,k):
    """
    Compute maclaurin's binomial series approximation for (1+x)^m.
    """
    global first_value
    first_value = 0.0
    error(value)

    #attempt to Approximate (1+x)^m for given values 
    try:
        
        for item in xrange(1,k):
            next_value =m*(value**item)/factorial(item)
            
            for i in range(2,item+1):              
                next_second_value =(m-i+1)
                next_value *= next_second_value
            first_value += next_value

        return first_value + 1
    
    #Raise TypeError if input is not within
    #the interval of convergence
    except TypeError,exception:
        print exception

    #Raise OverflowError if an over flow occur 
    except OverflowError:
        print '\n<Please enter a lower k value to avoid the Over flow\n '

    Compute maclaurin's binomial series approximation for (1+x)^m.
    
recipes/Python/577284_Maclaurinsseriesbinomialseries/recipe-577284.py