2 Answered Questions for the topic bit manipulation
Determine the sign of a 32 bit int?
! ~ & ^ | + << >>
I need to determine the sign of a 32 bit integer and I need to return 1 if positive, 0 if 0 and -1 if negative.
Any ideas? I first...
Fastest way to get sign in Java?
I'd like to get the sign of a `float` value as an `int` value of -1 or 1.
Avoiding conditionals is always a good idea in reducing computational cost. For instance, one way I can think of would be...
Still looking for help? Get the right answer, fast.
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.