MultivariatePolynomials.jl
MultivariatePolynomials.jl copied to clipboard
gcd of rational numbers
https://github.com/JuliaAlgebra/MultivariatePolynomials.jl/blob/c0fd0f0aeb3ad366fae68ebc2bb5ade0de752d2d/src/gcd.jl#L845
shouldn't it be the lcm of the denominators?
Could you provide an example of gcd computation that is incorrect?
using DynamicPolynomials
@polyvar x y z
gcd(1//2*x + 1//4*y + 1//3*z, 1)
outputs:
1//2
You expect it to be 1 or 1//12 ?
I'd expect it to be 1//12.
Note that the issue only occurs when there're more than 2 terms (as only then _simplifier is called):
using DynamicPolynomials
@polyvar x y
gcd(1//3*x + 1//4*y, 1)
outputs:
1//12