% Matlab diary from cs110a class #3, Jan 7 2005. % % This is what I typed in class. % % Type it into Matlab yourself to % reproduce the output I showed. format long a = 100 1/2 1/3 a = 1/3 b = a*3 1 - b 1/17 b = 1/17 a = 1 - 17*b a = 4/3 b = a-1 c = 3*b 1 - c format hex a =1 b = a/3 c = 3*b a = 4/3 b a-1 b = a-1 c = 3*b format long c 1 - c format hex 1-c format long 1-c log2 ( 2.220446049250313e-016 ) eps floatgui eps realmax log2(ans) realmin eps clc x = 1; while 1+x > 1, x = x/2, pause(.02), end x = 1; while x+x > x, x = 2*x, pause(.01),end realmax format hex Inf format long Inf 1/Inf 1/0 Inf + 3 Inf - Inf