{: test that ln(x) causes a fatal error if x <= 0 }

{$d+}
program d086( output );

var
   e,k : real;

function side : real;
begin
   side := k;
   k := k+1;
end;
begin {d086}

   k := 1;
   writeln( 'ln(1) is ', ln(side):1:1);
   if k <> 2 then
      writeln( 'ln() for debug has side effects' );

   k := 1;
   while k > 0 do begin
      e := k;
      k := k/2;
   end;
   writeln( 'ln(eps) is ', ln(e):9:4 );
   writeln( 'ln(0) is ', ln(0):9 ); {error}
   writeln( 'fails: ln(0) is not detected' );
end. { d086 }

