View Single Post
  #3  
Old 01-12-2020, 01:32
dila dila is offline
Friend
 
Join Date: Jan 2010
Posts: 60
Rept. Given: 12
Rept. Rcvd 32 Times in 14 Posts
Thanks Given: 35
Thanks Rcvd at 74 Times in 20 Posts
dila Reputation: 32
-x is the same as ~x + 1

In this case the code is extracting the most-significant bit (MSB) from a and then creating a 64-bit mask from it.

If MSB(a) == 0, the result is 0x0000000000000000
Otherwise, if MSB(a) == 1, the result is 0xFFFFFFFFFFFFFFFF
Reply With Quote