Floating Point Exceptions

Greetings All,

I have had this problem for quite some time, but still I see no way of
solving it.

My problem is trapping floating point exceptions without totally freezing
the system. I a unit, in which I have written a 'graph window component', I
have declared the following:

interface

type
  TFloat = Extended;

  TCurveFunction = function(X: TFloat): TFloat;

  TCurve = class(TObject)
    Curve: TCurveFunction;
    DefaultValue: TFloat;
    Show: Boolean;
    Color: TColor;
    Style: TPenStyle;
    function GetResult(X: TFloat): TFloat;
  end;

{ . . . }

implementation

function TCurve.GetResult(X: TFloat): TFloat;
begin
  try
    Result := Curve(X);
  except
    Result := DefaultValue;
  end;
end;

And it works fine, UNLESS TCurve.Curve is defined as (Y = 1 / X), (Y = ln X)
or similar. And it doesn't freeze at the first try either.

I ran a test, where TCurve.Curve was defined as (Y = Sqrt(X)). In a negative
loop, starting at -1, it froze at -129.

How can this be?