I’m trying to use the
GCD library function BigINT.js . But I do not know how, I try to use raw numbers, but it returns 0
In the description says
// bigInt GCD(x,y) // return greatest common divisor of bigInts x and y (each with same number of elements).
And I try to use it like this:
But it turns 0. How to use it correctly?
From the library code, in the same link you passed, you can see that the
GCD function expects you to pass two numbers in the
bigInt , there is the
You can read the following documentation at the top of the file:
// bigInt int2bigInt (t, n, m) // return a bigInt equal to integer t, with at least n bits and m array elements
// bigInt int2bigInt (t, n, m) // returns a bigInt equal to integer t, with at least n bits and an array of m elements
After obtaining the MDC, you can convert
bigInt to string and display its value, using the
still in the documentation at the top of the file:
// string bigInt2str (x, base) // return a string form of bigInt x in a given base, with 2