Ask Your Question

Revision history [back]

Replace s.factor() by QQ(s).factor() to convert the symbolic expression to a rational and to factor that rational. Indeed, SR(1/6).factor() yields 1/6 while QQ(1/6).factor() yields 2^-1 * 3^-1.