Algo así, mas o menos:
Código Delphi
[-]
procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c : Integer;
x1,x2,r : Real;
begin
a:= StrToInt(Edit1.Text);
b := StrToInt(Edit2.Text);
c := StrToInt(Edit3.Text);
if a=0 then
Edit4.Text:=FloatToStr(-c/b)
else
begin
r:=b*b-4*a*c;
if r<0 then
ShowMessage('Error!!!Raiz negativa, el resultado es imaginario')
else
begin
r:= Sqrt(r);
x1:= (-b+r)/(2*a);
x2:= (-b-r)/(2*a);
Edit4.Text:= FloatToStr(x1);
Edit5.Text:= FloatToStr(x2);
end;
end;
end;
...lo tenia a mano de algo que estaba haciendo...
Saludos