Форум: "Основная";
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];
ВнизPascal срочно, плзззз... Найти похожие ветки
← →
Rooman (2002-03-31 12:08) [18]А вот более оптимальный вариант той-же функции:
procedure swapbits(BitPos1,BitPos2:byte;var Number:longint);
var i1,i2,m:longint;tmp:byte;
begin
if BitPos1>BitPos2 then
begin
tmp:=BitPos1;
BitPos1:=BitPos2;
BitPos2:=tmp;
end;
i1:=1;
i2:=i1;
i1:=i1 shl BitPos1;
i2:=i2 shl BitPos2;
m:=BitPos2-BitPos1;
Number:=(Number and not(i1 or i2))xor (((Number and i1) shl m)xor((Number and i2) shr m));
end;
Страницы: 1 2 вся ветка
Форум: "Основная";
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];
Память: 0.43 MB
Время: 0.008 c