
% check the most negative value exactly representable
% as both a float32 and an int32; should be -2^31

k = -(2^31);

a1 = single(k);
b1 = int32(k);
c1 = int32(k-1);

a2 = double(a1);
b2 = double(b1);
c2 = double(c1);

[k - a2, k - b2, k - c2]

format long

k

format short




