fork download
  1. clear all;
  2. x0=0.5;
  3. x2=0.9;
  4. h=0.1;
  5. while(x0<x2)
  6. x0=x0+0.1;
  7. disp(x2-x0); % <-- I added this line
  8. end
  9. x0
Success #stdin #stdout 0.16s 65056KB
stdin
Standard input is empty
stdout
 0.30000
 0.20000
 0.10000
 1.1102e-16
-0.100000
x0 =  1.00000