CS321/HW2/sa2a.h
inline
int rot12(int val, int bits)
{
    assert(0 <= val && val <= 0xffff);
    assert(0 <= bits && bits < 12);

    return ((val << bits) & 0xfff) | (val >> (12-bits));
}
// rot12
// Left rotate of 12-bit value by given number of bits.
// Helper function for sa2a.
rot12
Left rotate of 12-bit value by given number of bits.
Helper function for sa2a.
rot12 Left rotate of 12 - bit value by given number of bits . Helper function for sa2a .
inline
int rot12(int val, int bits)
{
    assert(0 <= val && val <= 0xffff);
    assert(0 <= bits && bits < 12);
    return ((val << bits) & 0xfff) | (val >> (12-bits));
}
inline int rot12 ( int val , int bits ) { assert ( 0 <= val && val <= 0xffff ) ; assert ( 0 <= bits && bits < 12 ) ; return ( ( val << bits ) & 0xfff ) | ( val >> ( 12 - bits ) ) ; }
rot12
Left rotate of 12-bit value by given number of bits.
rot12 Left rotate of 12 - bit value by given number of bits .