Skip to content

fmpz_mpoly.gcd does not include content of polynomials #249

@RotemKalisch

Description

@RotemKalisch

When using fmpz_mpoly, the gcd contains the content of the polynomials:

>>> import flint
>>> ctx = flint.fmpq_mpoly_ctx.get('n')
>>> flint.fmpz_mpoly(4, ctx).gcd(flint.fmpz_mpoly(6, ctx)) 
2

However, when using fmpq_mpoly, gcd does not contain the content of the polynomials:

>>> import flint
>>> ctx = flint.fmpq_mpoly_ctx.get('n')
>>> flint.fmpq_mpoly(4, ctx).gcd(flint.fmpq_mpoly(6, ctx)) 
1

Digging further, I've noticed that fmpq does not have a gcd method, which could explain this root cause.
The GCD of two rationals a/b, c/d is simply extended as gcd(a*d, b*c) / (b*d).

I'm not sure if this falls under the category of a bugfix or a feature request, but is it possible to achieve this behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions