Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Fakultät (https://www.delphipraxis.net/35475-fakultaet.html)

NAK32 7. Dez 2004 18:53


Fakultät
 
WIe kann ich in delphi fakultäten berechnen?
ich habe Delphi 5.0 ud ein einfaches x:=!x; hilft nciht

Ultimator 7. Dez 2004 18:56

Re: Fakultät
 
Das dürfte gehen :-)

Eine Suche nach [dp]Fakultät[/dp] hätte es aber auch getan ;-)

arbu man 8. Dez 2004 13:06

Re: Fakultät
 
sollte auch gehen

Delphi-Quellcode:
Function fak(s:string):string;
var f,f2:integer;
f1:extended;
begin
F:=0;
f1:=round(strtofloat(s));
f2:=1;
repeat begin
f:=f+1;
F2:=f2*f;
end; until f1=f;
result:=inttostr(f2);
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:47 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz