1 | initial version |
Conversion from symbolic fraction to fraction field element:
sage: ex=(x+1)/(x-1); ex
(x + 1)/(x - 1)
sage: ex.numerator().polynomial(ZZ)/ex.denominator().polynomial(ZZ)
(x + 1)/(x - 1)
sage: type(_)
<type 'sage.rings.fraction_field_element.FractionFieldElement'>
2 | No.2 Revision |
Conversion from symbolic fraction to fraction field element:
sage: ex=(x+1)/(x-1); ex
(x + 1)/(x - 1)
sage: ex.numerator().polynomial(ZZ)/ex.denominator().polynomial(ZZ)
(x + 1)/(x - 1)
sage: type(_)
<type 'sage.rings.fraction_field_element.FractionFieldElement'>
The / operator applied to polynomial elements automagically creates the right fraction field.
3 | No.3 Revision |
Conversion from symbolic fraction to fraction field element:
sage: ex=(x+1)/(x-1); ex
(x + 1)/(x - 1)
sage: ex.numerator().polynomial(ZZ)/ex.denominator().polynomial(ZZ)
(x + 1)/(x - 1)
sage: type(_)
<type 'sage.rings.fraction_field_element.FractionFieldElement'>
The / operator applied to polynomial elements automagically creates the right fraction field.field.
I admit that having a fraction conversion method for expressions (like the polynomial conversion)
would be worthwhile.
4 | No.4 Revision |
Conversion from symbolic fraction to fraction field element:
sage: ex=(x+1)/(x-1); ex
(x + 1)/(x - 1)
sage: ex.numerator().polynomial(ZZ)/ex.denominator().polynomial(ZZ)
(x + 1)/(x - 1)
sage: type(_)
<type 'sage.rings.fraction_field_element.FractionFieldElement'>
The / operator applied to polynomial elements automagically creates the right fraction field. I admit that having a fraction conversion method for expressions (like the polynomial conversion) would be worthwhile.
This is now trac ticket #17539.