Thema: Delphi Vielfaches von 2

Einzelnen Beitrag anzeigen

Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#6

Re: Vielfaches von 2

  Alt 24. Sep 2006, 12:26
Und noch eine Möglichkeit:

Delphi-Quellcode:
function IsEven(X: Integer): Boolean;
asm
and al, $1
not al
end;
(EDIT: Kleine Optmierung)
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat