On Jun 6, 12:36 pm, Ivannie <[email protected]> wrote:
> Hello everyone,
>
>     Now I am doing something on trigsimp in simplify.py, I wonder how
> can I get to know if a symbol a fraction?
>

Do you mean a symbol or do you mean an expression? I'm not sure a
symbol (like x) can have a fraction attribute, but an expression like
y=x/3 can be tested to see if it is a fraction or not by looking at
the item in the 2nd position of the tuple that fraction(y) returns:

###
>>> x=var('x')
>>> y=x/3
>>> fraction(y)
(x, 3)
>>> fraction(x)
(x, 1)
###

In the case that there is something in the denominator, the 2nd value
in the tuple is not 1.

/c
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to