Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bit twiddling in C#
Message
De
16/02/2006 13:14:47
 
 
À
15/02/2006 12:51:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01096485
Message ID:
01096815
Vues:
19
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"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform