Ask Your Question
1

Calculating the degree of the lowest non-zero term of a polynomial

asked 2022-01-30 19:55:12 +0100

Rune gravatar image

I was wondering if there was a way to calculate the degree of the lowest non-zero term of a polynomial. What I mean by this is that, for example, for x^2+7x^4+x^5, I would like to return 2, for 7x+x^2+7x^4+x^5 I would like to return 1, for 1+7x+x^2+7x^4+x^5 I would like to return 0, ect...

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2022-01-30 19:59:08 +0100

Max Alekseyev gravatar image

updated 2022-01-30 19:59:48 +0100

Yes - it's returned by .ord() method:

R.<x> = QQ[]
print( (7*x+x^2+7*x^4+x^5).ord() )
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-01-30 19:55:12 +0100

Seen: 164 times

Last updated: Jan 30 '22