Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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!

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!