Page 1 of 1

Rol and Ror operators missing

PostPosted: Wed Nov 17, 2010 7:52 am
by udo.killermann
Bernd,

the bit operators would profit if you add rotate operators to it. Rotate looks at the bit pattern as a ring and if a bit leaves at one end it re enters on the other.
So if you rotate 0x5 (b00000101) one bit right it would become 0x82 (b10000010) when you assume the value to be 8 bits wide. Rotating it to the left would produce 0xa (b00001010). Rotation operators e.g. are used for crypto operation.

Regards
Udo

Re: Rol and Ror operators missing

PostPosted: Thu Nov 18, 2010 10:16 am
by berndnoetscher
udo.killermann wrote:Bernd,

the bit operators would profit if you add rotate operators to it. Rotate looks at the bit pattern as a ring and if a bit leaves at one end it re enters on the other.
So if you rotate 0x5 (b00000101) one bit right it would become 0x82 (b10000010) when you assume the value to be 8 bits wide. Rotating it to the left would produce 0xa (b00001010). Rotation operators e.g. are used for crypto operation.

Regards
Udo


Interesting, didn't know it before. Will do it in the next releases...