fn poly_extract_common(mut f: Poly, mut g: Poly) -> (isize, Poly, Poly) {
    // extracts 'Common gcd content' from polys
    let fc = poly_coeffs_gcd(&f);
    let gc = poly_coeffs_gcd(&g);
    let gcd = gcd(fc, gc) as isize;

    if gcd == 0 {
        (1, f, g)
    } else {
        f = f.div_scalar(gcd).unwrap();
        g = g.div_scalar(gcd).unwrap();
        (gcd, f, g)
    }
}
/// Extracts a constant coefficient from two polynomials.
/// Returns a tuple of (constant, f_quotient, g_quotient).
Extracts a constant coefficient from two polynomials.
Returns a tuple of (constant, f_quotient, g_quotient).
Extracts a constant coefficient from two polynomials . Returns a tuple of ( constant f_quotient g_quotient ) .
fn poly_extract_common(mut f: Poly, mut g: Poly) -> (isize, Poly, Poly) {
    // extracts 'Common gcd content' from polys
    let fc = poly_coeffs_gcd(&f);
    let gc = poly_coeffs_gcd(&g);
    let gcd = gcd(fc, gc) as isize;
    if gcd == 0 {
        (1, f, g)
    } else {
        f = f.div_scalar(gcd).unwrap();
        g = g.div_scalar(gcd).unwrap();
        (gcd, f, g)
    }
}
fn poly_extract_common ( mut f : Poly , mut g : Poly ) -> ( isize , Poly , Poly ) { // extracts 'Common gcd content' from polys let fc = poly_coeffs_gcd ( & f ) ; let gc = poly_coeffs_gcd ( & g ) ; let gcd = gcd ( fc , gc ) as isize ; if gcd == 0 { ( 1 , f , g ) } else { f = f . div_scalar ( gcd ) . unwrap ( ) ; g = g . div_scalar ( gcd ) . unwrap ( ) ; ( gcd , f , g ) } }
Extracts a constant coefficient from two polynomials.
Extracts a constant coefficient from two polynomials .
f
Poly
g
Poly
f
Poly
g
Poly