Ask Your Question
1

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

asked 3 years ago

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...

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

Max Alekseyev gravatar image

updated 3 years ago

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

R.<x> = QQ[]
print( (7*x+x^2+7*x^4+x^5).ord() )
Preview: (hide)
link

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: 3 years ago

Seen: 171 times

Last updated: Jan 30 '22