Untitled

 avatar
unknown
plain_text
3 months ago
356 B
5
Indexable
    public static byte S3(int rejestr, byte wzor)
    {
        byte counter = 0;
        byte pattern = (byte)(wzor & 0b11);

        for (int i = 0; i < 31; i++)
        {
            if ((rejestr & 0b11) == pattern)
            {
                counter++;
            }
            rejestr >>= 1;
        }

        return counter;
    }
Editor is loading...
Leave a Comment