Click here to Skip to main content
15,903,856 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
int i1 = (-4000 >>> 4));
int i = (-4000 >> 4));

I have 2 line of code, if i want to change >>> shift operator to >> operator, then i trouble, because it take only unsigned variable. how we got signed value result.The c# not support >>> this operator, then i have to use >> operator, and store the same result of >>> this operator.
What i want to change.pls help me.
Posted
Updated 9-May-11 16:33pm
v3
Comments
Member 4312989 9-May-11 9:20am    
What does this >>> operator do?

Hello there
Check Out This Post. This May Be Helpful If Not Let Us Know
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/6c892d10-75ff-4f4e-a555-3017f72ec170/[^]
or
http://social.msdn.microsoft.com/Forums/en-CA/csharplanguage/thread/d639ee2e-44ac-4e7d-9f19-7ee2414f9631[^]
as c#.NET do not have any Unsigned Right Shift Operator. you can find the more details of the operators possible in C#.NET :
http://msdn.microsoft.com/en-us/library/6a71f45d%28vs.71%29.aspx[^]

best regards.
 
Share this answer
 
v2
Comments
Ravi Sharma 2 10-May-11 2:00am    
Thanks , this solved my problem and i complete my project.
In C#, just use bitwise shift operators "<<" and ">>". Who told you there is any problem with signed numbers? The operation is defined for int, which is signed. You second line will work correctly (if you remove extra bracket!).

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900