ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 05 May 2015 11:47:27 +0200TypeError: non-integral exponents not supportedhttps://ask.sagemath.org/question/26718/typeerror-non-integral-exponents-not-supported/Being new to Sage, I can't understand this error "TypeError: non-integral exponents not supported". This is raised by "find_root" in the following code snippet:
R.<x>=RR[]
n=1000
betas=[0.01,0.03,0.05,0.07,0.99,0.91]
#for beta in betas:
#for beta in srange(0.01,0.09,0.02):
for beta in srange(0.91,0.99,0.02):
f=x^n - 3*x^(n-1)+x^(n-2)+x^(n-3)-2*x^(n-beta*n-1)-3^(beta*n)
find_root(f, 1,4);
But what is strange for me is that if I replace the "for" line with one of the commented line, then it works well. So I think there must be some Sage concepts that I haven't been aware of.
Thanks for your help!LéoTue, 05 May 2015 11:47:27 +0200https://ask.sagemath.org/question/26718/Exponent overflow in PolynomialRing(): need a work aroundhttps://ask.sagemath.org/question/10102/exponent-overflow-in-polynomialring-need-a-work-around/PolynomialRing() gives an OverflowError for exponents larger than 32768.
For example
sage: R = GF(2**28, 'a')
sage: a = R.gen()
sage: x = PolynomialRing(R, 'x', 4).gens()
sage: f = x[0]**32768
sage: f = x[0]**32769
...
OverflowError: Exponent overflow (32769).
I need to make a function containing `x[0]**(2**28 - 2)`.
How can I get Sage to do that?
I am using Sage Version 5.3, Release Date: 2012-09-08.apeelWed, 08 May 2013 09:53:01 +0200https://ask.sagemath.org/question/10102/