Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bit twiddling in C#
Message
From
16/02/2006 13:14:47
 
 
To
15/02/2006 12:51:15
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01096485
Message ID:
01096815
Views:
21
You've got me thinking...

If sizeof(int) = 4 and int x, y then x = y >> 31 should return -1 and 0 or you could return -1 and 1 from maybe something like x = (y >> 31) << 1 + 1

Right? I don't think the 2nd example would be very fast though
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform