I want to use matlab to convert a very large integer (can be larger than 2^255) to a 256 bits long binary sequence, but since the integer is so large that, matlab will do some rounding operation, like: they will treat 2^2562 the same as 2^256, if you input 2^256(2^2562) in matlab, the result will be 0. So when I convert the 2^256 and 2^2562 to binary sequences, the results will be the same.
I have tried with "de2bi", and I have also written a function by myself, but both do not help :
%calculate binary representation of integer, whose highestorder digit is the rightmost one.
function out = dediconv(integer,n)
out = zeros(1,n);
if integer < 2^n
for i=n:1:1
if integer>=2^(i1)
out(i) = 1;
integer = integer  2^(i1);
end
if integer == 0
break;
end
end
else
error('debiconf_shan: the given length n is too small for representing the given integer.' );
end
