1
0
forked from kalmar/DALGLI0
DALGLI0/02-rozwiazanie.js
Kacper Kruczek 3393e46235 02
2018-06-29 16:10:38 +02:00

19 lines
476 B
JavaScript

let Polynomial = require('./polynomial.js');
let mul, div, gcd;
console.log(process.argv[2]);
let n = parseInt(process.argv[2]);
let f = new Polynomial.Class([1, 1, 1, 0, 1]);
let g = new Polynomial.Class([0, 1, 1]);
mul = Polynomial.multiply(f, g, 2).coefficients;
try {
div = Polynomial.divide(f, g, 2).coefficients
} catch (e) {
console.log(e)
}
try {
gcd = Polynomial.gcd(f, g, 2).coefficients;
} catch (e) {
console.log(e);
}
console.log([mul, div, gcd])