Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using the Alekseyev suggestion I was able to write a python function that solves the problem.

def common_factor(expr_list):
numerators, denominators = zip(*map(lambda expr: (expr.numerator(),expr.denominator()),expr_list))
return gcd(numerators)/gcd(denominators)

Using the Alekseyev suggestion I was able to write a simple python function that solves the problem.

def common_factor(expr_list):
numerators, denominators = zip(*map(lambda expr: (expr.numerator(),expr.denominator()),expr_list))
zip(*[expr.numerator_denominator() for expr in expr_list])
return gcd(numerators)/gcd(denominators)

Using the Alekseyev suggestion I was able to write a simple python function that solves the problem.

def common_factor(expr_list): numerators, denominators = zip(*[expr.numerator_denominator() for expr in expr_list]) return gcd(numerators)/gcd(denominators)

gcd(numerators)/gcd(denominators)

Using the Alekseyev suggestion I was able to write a simple python function that solves the problem.

def common_factor(expr_list): numerators, denominators = zip(*[expr.numerator_denominator() for expr in expr_list]) return gcd(numerators)/gcd(denominators)

Using the @Max Alekseyev suggestion I was able to write a simple python function that solves the problem.

def common_factor(expr_list):
    numerators, denominators = zip(*[expr.numerator_denominator() for expr in expr_list])
    return gcd(numerators)/gcd(denominators)