MATLAB: Warning: Inputs contain values larger than the largest consecutive flint

MATLAB

Hello all.
Does anyone know under which circumstances this warning is raised? I got this when I used the gcd function with gcd(x,2^11), where x is a vector with randomly generated integers.
Thank you in advance for any insight.

Best Answer

You got too big integers for the function to be accurate.
function warnIfGreatThanLargestFlint(A,B,classCheck)
if strcmp(classCheck,'double')
largestFlint = 2^53-1;
else % single
largestFlint = 2^24-1;
end
if any(abs(A(:)) > largestFlint) || any(abs(B(:)) > largestFlint)
warning('MATLAB:gcd:largestFlint', '%s\n%s', ...
'Inputs contain values larger than the largest consecutive flint.', ...
' Result may be inaccurate.');
end