On 9 jul, 16:36, William Stein <
wst...@gmail.com> wrote:
Good point. The thing is not clear:
{{{
sage: R.<x>=QQ['x']
sage: denominator(x/2)
2
sage: denominator(R.fraction_field()(x/2))
1
}}}
Should it be the same result for univariate polynomials and the
coercion to univariate rational functions?
What are the reasons to implement denominator this way for univariate
polynomials?
I have to take a look to the logic behind this, there are further
problems (maybe another track)
{{{
sage: N.<a>=NumberField(x**2-5/2)
sage: denominator(1/a)
5
sage: numerator(1/a)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/luisfe/.sage/temp/mychabol/4554/
_home_luisfe__sage_init_sage_0.py in <module>()
/opt/SAGE/sage/local/lib/python2.5/site-packages/sage/misc/
functional.pyc in numerator(x)
686 if isinstance(x, (int, long)):
687 return x
--> 688 return x.numerator()
689
690 def numerical_approx(x, prec=None, digits=None):
AttributeError: 'sage.rings.number_field.number_field_element_quadr'
object has no attribute 'numerator'
}}}
Even not every univariate polynomial ring has defined numerator
{{{
sage: R.<y>=N[]
sage: denominator(y)
1
sage: numerator(y)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/luisfe/.sage/temp/mychabol/4554/
_home_luisfe__sage_init_sage_0.py in <module>()
/opt/SAGE/sage/local/lib/python2.5/site-packages/sage/misc/
functional.pyc in numerator(x)
686 if isinstance(x, (int, long)):
687 return x
--> 688 return x.numerator()
689
690 def numerical_approx(x, prec=None, digits=None):
AttributeError: 'Polynomial_generic_dense_field' object has no
attribute 'numerator'
}}}