class INTI_EXT


Flattened version is here



Public


Features
checkDivZ(a0,b0,p:INTI):BOOL
**** true if exist "k" s.t. (b+k*prime)|a in Z
extended_gcd(a:ARRAY{INTI}, out factor:ARRAY{INTI}):INTI
**** multi GCD. return GCD g. g = a . factor
extended_gcd(i,j:INTI, out f1: INTI, out f2:INTI):INTI
**** gcd = i*f1 + j*f2 x:SAME:=one; y:SAME:=zero; u:SAME:=zero; v:SAME:=one;
factorize(n:INTI):ARRAY{INTI}
**** return array of factors with duplication
gcd(a:ARRAY{INTI}):INTI
**** multi GCD. return GCD of elements of a[].
gcd(i,j:INTI):INTI
getDivisors(n:INTI):ARRAY{INTI}
**** get all divisors of n
inv(p,g:INTI):INTI
**** inverse of g as finite field Zp. i.e. p:prime. g*inv(p,g)=1 (mod p).
is_fpsp(x,a:INTI):BOOL
**** is prime or Fermat's pseudo prime of base "a"? return (a^(x-1.inti)%x=1.inti);
is_prime(x:INTI):BOOL
**** Is __x__ prime?
is_spsp(x,a:INTI):BOOL
**** is prime or strong pseudo prime of base "a"?
next_prime(n:INTI):INTI
**** prime next to n. (minimum prime >n)


Private

getDivisorsS(i:CARD, divisor:INTI,factors:ARRAY{INTI}, factord:ARRAY{CARD}):ARRAY{INTI}

The Sather Home Page