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.Wed, 26 Feb 2020 10:11:34 +0100Write a function "division" such that division(f,F) returns the quotient(s) and remainder of a polynomial f divided by an ordered tuple F of polynomials, where all polynomials live in a ring with an arbitrary number of variables. Zhttps://ask.sagemath.org/question/50030/write-a-function-division-such-that-divisionff-returns-the-quotients-and-remainder-of-a-polynomial-f-divided-by-an-ordered-tuple-f-of-polynomials/
Since you don't know a priori the number of elements in F, one option is to pass F to your function as a list. You can get the length of the list with #F and you can access its entries with F_0, F_1, etc. Similarly, you can return the quotients in a list{q1,q2,...,qs}. There is a section on lists in the M2 documentation under The Macaulay2 Language -> lists and sequences.
Sun, 23 Feb 2020 00:21:55 +0100https://ask.sagemath.org/question/50030/write-a-function-division-such-that-divisionff-returns-the-quotients-and-remainder-of-a-polynomial-f-divided-by-an-ordered-tuple-f-of-polynomials/Comment by vdelecroix for <p>Since you don't know a priori the number of elements in F, one option is to pass F to your function as a list. You can get the length of the list with #F and you can access its entries with F_0, F_1, etc. Similarly, you can return the quotients in a list{q1,q2,...,qs}. There is a section on lists in the M2 documentation under The Macaulay2 Language -> lists and sequences.</p>
https://ask.sagemath.org/question/50030/write-a-function-division-such-that-divisionff-returns-the-quotients-and-remainder-of-a-polynomial-f-divided-by-an-ordered-tuple-f-of-polynomials/?comment=50039#post-id-50039What is your question?Sun, 23 Feb 2020 10:25:36 +0100https://ask.sagemath.org/question/50030/write-a-function-division-such-that-divisionff-returns-the-quotients-and-remainder-of-a-polynomial-f-divided-by-an-ordered-tuple-f-of-polynomials/?comment=50039#post-id-50039Comment by Emmanuel Charpentier for <p>Since you don't know a priori the number of elements in F, one option is to pass F to your function as a list. You can get the length of the list with #F and you can access its entries with F_0, F_1, etc. Similarly, you can return the quotients in a list{q1,q2,...,qs}. There is a section on lists in the M2 documentation under The Macaulay2 Language -> lists and sequences.</p>
https://ask.sagemath.org/question/50030/write-a-function-division-such-that-divisionff-returns-the-quotients-and-remainder-of-a-polynomial-f-divided-by-an-ordered-tuple-f-of-polynomials/?comment=50071#post-id-50071Homework ?
Note that nobody will do your homework for you...Wed, 26 Feb 2020 10:11:34 +0100https://ask.sagemath.org/question/50030/write-a-function-division-such-that-divisionff-returns-the-quotients-and-remainder-of-a-polynomial-f-divided-by-an-ordered-tuple-f-of-polynomials/?comment=50071#post-id-50071