% Matlab diary from cs111, Oct 24 2007. % % This is what I typed in class. % % Type it into Matlab yourself to % reproduce the output I showed. diary on format hex clc a = 1.618 format hex format long a format hex a -a a format long hex2dec('3ff') 1 1 + 1/2 + 1/16 + 1/32 ans + 1/64 + 1/128 a format hex a 1 1.5 1 + 1/4 1 + 1/8 1+ 1/16 1 + 1/32 1 2 -2 1 1/2 format long 2 ^ -1000 format hex 2 ^ -1000 2 1 format long 2^1000 format hex 2^1000 0 inf 1 / 0 format long 1 / 0 -1 / 0 format hex -1 / 0 Inf + Inf format long Inf + Inf 2 * inf - inf inf + 1 inf - 1 inf / 2 inf - inf 0/0 1/0 nan format hex nan -inf 0 -0 (0) == (-0) 2 < 1 2 < inf 2 < nan nan == nan inf == inf inf == inf+1 isnan(1) isnan(0/0) 0/0 == nan inf == 1/0 inf == -1/0 isinf(1/0) isinf(-1/0) isinf(nan) isnan(inf) diary off