Autor Beitrag
sekingofsering
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 31.01.05 20:42 
würde gern den ausdruck ((-1)^(i+1))/(2i) berechnen wie muss ich das in delphi ausdrücken wie berechnet mann pontenzen....

ausblenden Delphi-Quelltext
1:
2:
3:
for i=1 to 151 do 
begin
ai[i]: =????((-1)^(i+1))/(2i)????


danke lg
michi

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 31.01.05 20:45 
Du musst die Unit "Math" einbinden. Dann hast du die Funktion "Power" zuzur Verfügung. Alles weitere steht in der OH.
sekingofsering Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 31.01.05 20:48 
wie binde ich die unit . maht ein
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 31.01.05 20:50 
In der Unit, wo du die Funktion nutzen willst, steht irgendwo ganz oben "Uses". Dann kommt eine Liste von anderen Units. Da schreibst du Unit "Math" mit hinein.
Elite
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 31.01.05 20:50 
Du musst sie der uses-Liste hinzufügen:
ausblenden Delphi-Quelltext
1:
2:
uses
 forms, dialogs, math...
sekingofsering Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 31.01.05 20:56 
ok ...wie schaut dann der code für mein bsp aus....
sekingofsering Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 31.01.05 21:01 
wenn ich die funtion ein bau ..

ausblenden Delphi-Quelltext
1:
2:
3:
 for i=1 to 151 do   
begin  
ai[i]:= funktion (.....


oder

ausblenden Delphi-Quelltext
1:
2:
3:
4:
 for i=1 to 151 do   
begin  
funktion(....
ai[i]:=


dann schreibt er anweisung erwartet aber funktion gefunden....

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Mo 31.01.05 21:04 
nein er meint mit der funktion Power das hier :
ausblenden Delphi-Quelltext
1:
function Power(const Base, Exponent: Extended): Extended;					

zb 3^2 wäre
ausblenden Delphi-Quelltext
1:
Power(3,2);					


mfg matze

_________________
si tacuisses, philosophus mansisses.
sekingofsering Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 31.01.05 21:06 
danke für denn guten hinweis
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Mo 31.01.05 21:11 
((-1)^(i+1))/(2i) wäre in delphi:
ausblenden Delphi-Quelltext
1:
2:
for i=1 to 151 do 
  ai[i]: = Power(-1,i+1)/(2*i);


mfg matze

//Edit: Anfängern is man ja immer bisl netter in sachen "löse das problem für mich" :D hoffe du verstehst es.

_________________
si tacuisses, philosophus mansisses.