Hi DaHui,
Willkommen
Ich denke Du wolltest es so haben:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
p, q, x: double;
begin
if (edit1.text = '') or (edit2.text = '') then
Application.MessageBox('Kein Wert angegeben', 'Fehler', MB_OK + MB_ICONERROR)
else
begin
p := strtofloatdef(edit1.Text, 0);
q := strtofloatdef(edit2.Text, 0);
x := -1 * (1 / 2 * p) - sqrt(sqr(p / 2) - q);
Label1.caption := Floattostr(x);
x := -1 * (1 / 2 * p) + sqrt(sqr(p / 2) - q);
Label2.caption := Floattostr(x);
end;
end;
mfg
BrunoT