Small functions for a certain bit of a bit of an integer in Delphi

zhaozj2021-02-16  99

Type

TposRange = 0..32;

TSTATERESULT = 0..1;

Function GetBitsate (Source: Integer; POS: TPOSRANGE): TSTATERESULT

Begin

Result: = ((Source and (1 shl POS)) SHR POS);

END;

转载请注明原文地址:https://www.9cbs.com/read-11199.html

New Post(0)