Sign in
Log inSign up

Bitwise Not operator in javascript

Default profile photo
Anonymous
·Mar 19, 2018

var num1 = 25 // binary 11001

var num2 = ~num1 // binary 111111111111111100110

alert(num2) = -26;

In the above scenario I am applying bitwise not operator to num1, but after alerting the value I am getting -26 which is totally different from the binary value