Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
Delphi 10.2 Tokyo Professional
|
AW: Schnelle SwapByte Routine - Bits swappen
23. Feb 2016, 11: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."
|