Autor Beitrag
arnydaniel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80

hoffentlich bald Linux
Delphi 6
BeitragVerfasst: Di 07.09.04 15:06 
Hi,

wie kann ich mit Delphi x hoch y rechen?? Bin schon am verzweifeln!
Könntet ihr vielleicht einfach mal den entspr. Code posten?

Danke


Moderiert von user profile icontommie-lie: Topic aus Sonstiges verschoben am Sa 11.09.2004 um 14:43
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 07.09.04 15:14 
Das ist ganz einfach: In der Unit math ist die Funktion power drin:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
usses math;
[...]
var x :double;
x:=power(2,3);

x hat dann den Wert 2^3=8

_________________
We are, we were and will not be.
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: Di 07.09.04 15:18 
Oder wenn du math nicht verwenden willst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
  x, y, z : Extended;
begin
  x:=2;
  y:=3;
  z:=Exp(y*ln(x));
  ...


Gruß,
Jörg

_________________
Die Antworten auf die 5 häufigsten Fragen:
1. Copy(), Pos(), Length() --- 2. DoubleBuffered:=True; --- 3. Application.ProcessMessages bzw. TThread --- 4. ShellExecute() --- 5. Keine Vergleiche von Real-Typen mit "="!