[R] Binary Number To Two´s Complement Representation

Paul Bernal p@u|bern@|07 @end|ng |rom gm@||@com
Mon Jan 20 15:57:56 CET 2020


Dear Rui,

Based on the rules given in the link below, I want to transform the binary
numbers into latitude and longitude coordinates (in degrees and minutes),
so that is basically what I am trying to accomplish. The first integer
gives the sign (positive or negative) of the number, and the rest n-1
digits, give the magnitude of the number.

So for example: 01111001, the first integer indicates that the decimal is
positive, and, in the case of 1001011. the first integer starts with "1",
so that means the number is negative, then the rest of the integers give
the actual number, while the first integer (from left to right) give the
sign, with 0 meaning it´s a positive integer, and 1 meaning is a negative
integer.

Best regards!

https://www.electronics-tutorials.ws/binary/signed-binary-numbers.html

	[[alternative HTML version deleted]]



More information about the R-help mailing list