{ prog1a.pas -- Determine Machine Epsilon Written Feb 20, 2001 by Eric Olson for Mathematics 483 For more information see Step 3 in First Steps in Numerical Analysis, 2nd Edition, by Hosking, Joe, Joyce and Turner. } program main; var a,b,d,dold,x,r:real; begin while not eof do begin read(x); a:=0; if x>0 then b:=x else b:=-x; d:=(a+b)/2.0; repeat r:=x+d; if r=x then a:=d else b:=d; dold:=d; d:=(a+b)/2.0; until dold=d; writeln('x=',x,' d=',a) end end.