HP-16C
·
Table of Contents
Description #
#pragma mode( separator(.,;) integer(d64) )
Extract_Bits(Word, BitNum)
BEGIN
RETURN BITSL(SETBITS(#1,GETBITS(Word)), BitNum);
END;
EXPORT BITSET(Word, BitNum)
BEGIN
RETURN BITOR(Word, Extract_Bits(Word, BitNum));
END;
EXPORT BITCLEAR(Word, BitNum)
BEGIN
RETURN BITAND(Word, BITNOT(Extract_Bits(Word, BitNum)));
END;
EXPORT BITTEST(Word, BitNum)
BEGIN
RETURN (BITAND(Word, Extract_Bits(Word, BitNum)) <> #0);
END;
EXPORT BITNR(Word)
BEGIN
RETURN hamdist(Word,0);
END;
Download HP16C.Prime