Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#2

AW: Schnelle SwapByte Routine - Bits swappen

  Alt 23. Feb 2016, 10:15
Oder man spart sich die Tipparbeit auf andere Weise:
Delphi-Quellcode:
function SwapByte(B: Byte): Byte;
var i: Integer;
begin
  Result := 0;
  for i:= 0 to 7 do
    Result := Result or (((b shr i) and 1) shl (7-i));
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat