I have binary form for -3
in two's complement form - 11111111111111111111111111111101
, and use it with parseInt
function:
parseInt('11111111111111111111111111111101', 2)
But it returns 4294967293
, which is the integer that results if 11111111111111111111111111111101
is parsed as unsigned int. How can I parse integer as a signed one?