Autor Beitrag
darkdester
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Di 19.05.09 20:25 
irgendwie komme ich heute nicht zu pote...
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
m,j,j2:real;

m:=65;
j:=power(m,65537);
j2:= j mod N;

jetzt bringt er mir bei der letzen zeile
"[Pascal Error] Unit1.pas(266): E2015 Operator not applicable to this operand type"

wenn ich aber integer benutze, kommt bei j:=
"[Pascal Error] Unit1.pas(265): E2010 Incompatible types: 'Integer' and 'Single'"


wieso, weshalb, warum? wer nicht fragt bleibt dumm...

wo ist sein problem?

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 19.05.09 20:33 
Entweder du nutzt IntPower statt Power oder du rundest an der entsprechenden Stelle.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
darkdester Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Di 19.05.09 20:38 
ok..dann das nächste problem jetzt bei j2

[Pascal Error] Unit1.pas(268): E2015 Operator not applicable to this operand type

N ist integer, meckert er deswegen? falls ja, die var brauch ich global, wie kann ich die umwandeln oder anpassen das er da mod nutzen kann?
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Di 19.05.09 22:41 
Wieso hast du die Variablen als real deklariert..? Bei Power kann doch keine Kommazahl rauskommen.

_________________
PROGRAMMER: A device for converting coffee into software.
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: Di 19.05.09 22:46 
Hallo,

wie jakobwenzel schon schrieb.
power für real-zahlen und mod für integer.
Aber 65^65537 ist doch eh' über alle Grenzen des Rechners.
Aber Dein Vorhaben ist ja nicht unbekannt:
www.delphi-forum.de/...mp;highlight=mod+rsa
Mit BenBe's BigNum
www.delphi-forum.de/...mp;highlight=mod+rsa

Gruß Horst