If 'f' is a fraction, can someone please tell me how to separate the numerator and denominator of f???? I tried f.numerator and f.denominator but it doesnt seem to work...
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/kvXX5VvGsTAJ.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
In [380]: Rational(3, 4).as_numer_denom()
(3, 4)
In [381]: (x/y).as_numer_denom()
(x, y)
There's also the fraction() function, which does almost the same thing:
In [382]: fraction(Rational(3, 4))
(3, 4)
In [383]: fraction(x/y)
(x, y)
Aaron Meurer
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.