Autor Beitrag
spongeBHV
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Sa 16.12.06 17:24 
hallo.

ich will potenzen aus mathematischen funktionen berechnen lassen. wenn ich es comilieren lassen will sat er mir aber, das POWER kein definierter Bezeichner wäre. aber das ist doch die Funktion in delphi für einen exponenten größer als 2, oder?

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
procedure TForm1.B_BerechneClick(Sender: TObject);
var x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,
    s0,s1,s2,s3,s4,b1,b2,b3,xmin,ymin: single;
    i, j : Integer;
begin
     for j:= 1 to 11 do
     x1 := StrToFloat (sg_messdaten.Cells [2,j]);
     y1 := StrToFloat (sg_messdaten.Cells[3,j]);
     x2 := StrToFloat (sg_messdaten.Cells[4,j]);
     y2 := StrToFloat (sg_messdaten.Cells[5,j]);
     x3 := StrToFloat (sg_messdaten.Cells[6,j]);
     y3 := StrToFloat (sg_messdaten.Cells[7,j]);
     x4 := StrToFloat (sg_messdaten.Cells[8,j]);
     y4 := StrToFloat (sg_messdaten.Cells[9,j]);
     x5 := StrToFloat (sg_messdaten.Cells[10,j]);
     y5 := StrToFloat (sg_messdaten.Cells[11,j]);
     x6 := StrToFloat (sg_messdaten.Cells[12,j]);
     y6 := StrToFloat (sg_messdaten.Cells[13,j]);
     x7 := StrToFloat (sg_messdaten.Cells[14,j]);
     y7 := StrToFloat (sg_messdaten.Cells[15,j]);
     x8 := StrToFloat (sg_messdaten.Cells[16,j]);
     y8 := StrToFloat (sg_messdaten.Cells[17,j]);
     x9 := StrToFloat (sg_messdaten.Cells[18,j]);
     y9 := StrToFloat (sg_messdaten.Cells[19,j]);
     x10 := StrToFloat (sg_messdaten.Cells [20,j]);
     y10 := StrToFloat (sg_messdaten.Cells [21,j]);

     s0 := StrToFloat (sg_messdaten.Cells [1,j]);
     s1 := x1+x2+x3+x4+x5+x6+x7+x8+x9+x10;
     s2 := SQR(x1)+SQR(x2)+SQR(x3)+SQR(x4)+SQR(x5)+SQR(x6)+SQR(x7)+SQR(x8)+SQR(x9)+SQR(x10);//SQR bildet das Quadrat
     s3 := POWER(x1,3)+POWER(x2,3)+POWER(x3,3)+POWER(x4,3)+POWER(x5,3)+POWER(x6,3)+POWER(x7,3)+POWER(x8,3)+POWER(x9,3)+POWER(x10,3);   //POWER bildet beliebige Potenzen
     s4 := POWER(x1,4)+POWER(x2,4)+POWER(x3,4)+POWER(x4,4)+POWER(x5,4)+POWER(x6,4)+POWER(x7,4)+POWER(x8,4)+POWER(x9,4)+POWER(x10,4);
     b1 := y1+y2+y3+y4+y5+y6+y7+y8+y9+y10;
     b2 := y1*x1+y2*x2+y3*x3+y4*x4+y5*x5+y6*x6+y7*x7+y8*x8+y9*x9+y10*x10;
     b3 := y1*SQR(x1)+y2*SQR(x2)+y3*SQR(x3)+y4*SQR(x4)+y5*SQR(x5)+y6*SQR(x6)+y7*SQR(x7)+y8*SQR(x8)+y9*SQR(x9)+y10*SQR(x10);



Moderiert von user profile iconChristian S.: Topic aus VCL (Visual Component Library) verschoben am So 17.12.2006 um 13:44
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Sa 16.12.06 17:27 
Ohne jetzt deinen Code genauer gelesen zu haben:
Power ist in der Unit math definiert, die einfach mit uses math; einbinden.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."