function TF = isProbablePrimeJ(N)
% isProbablePrimeJ - tests if N is prime, using a Miller-Rabin test
% 
% isProbablePrimeJ converts the number to a Java.Math.BigInteger form,
% then uses isprime for that class, which performs a Miller-Rabin test.
%
% N is assumed to be a symbolic toolbox integer, or an array of
% such integers.

% convert N into a character form. no test is done to insure that N is
% indeed purely numeric.
if ischar(N)
  CN = N;
else
  CN = char(N);
end

JNum = java.math.BigInteger(CN);

% now just pass the call to isProbablePrime
TF = JNum.isProbablePrime(100);




