Hello,

Is this what you want?


x <- "10110010"
strtoi(x, base = 2)
#[1] 178


Hope this helps,

Rui Barradas

Às 16:31 de 16/01/20, Paul Bernal escreveu:
Dear friends,

How can I convert the following binary number in two´s complement
representation in R?

10110010

Any help and/or guidance will be greatly appreciated,

Best regards,

Paul

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to