Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > dotnet framework > march 2004 >

dotnet framework : _rotl


Gilles
3/29/2004 11:56:07 PM
Does anyone know how to use the _rotl function or if there an equivalent in C#

Tanks for your hel
Gilles
3/30/2004 2:51:06 AM
The shift operation replaces the shifted bits by 0
What I would like is that the shifted bit goes to the right of the byte

Any idea

Thank

Gilles
3/30/2004 5:01:08 AM
Yes, many thanks for your help

Jon Skeet [C# MVP]
3/30/2004 9:25:14 AM
[quoted text, click to view]

Anything wrong with using the left shift operator?

int x = y << z;

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
Jon Skeet [C# MVP]
3/30/2004 12:01:18 PM
[quoted text, click to view]

Ah, I see. Sorry! Well, you could do:

public static uint RotateLeft (uint original, int bits)
{
return (original << bits) | (original >> (32-bits));
}

Does that help?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
Josip Medved
3/30/2004 1:00:50 PM
[quoted text, click to view]

(x << z) | (x >> (32 -z))

--

Pozdrav,
Josip Medved, MCP
http://www.jmedved.com

Josip Medved
3/30/2004 1:23:00 PM
[quoted text, click to view]


nice one... only I was 28 seconds faster... :))

--

Pozdrav,
Josip Medved, MCP
http://www.jmedved.com

AddThis Social Bookmark Button