base+conversions

=BASE CONVERSIONS=

converting from decimal to binary (integer part)
1) you start dividing the decimal number by 2 continously until it can´t be divided anymore. the union of all the remainders backwards give us the number in binary.

example: convert the decimal number 100 into binary.

2)add the positions of the potencies of the decimal number on base 2 (2 because it´s binar, 8 if it where octal, etc...) until it give us the decimal number.

example: &d192 (2^7) ||= 64 (2^6) ||= 32 (2^5) ||= 16 (2^4) ||= 8 (2^3) ||= 4 (2^2) ||= 2 (2^1) ||= 1 (2^0) ||
 * = 128
 * = 1 ||= 1 ||= 0 ||= 0 ||= 0 ||= 0 ||= 0 ||= 0 ||

Converting adecimalnumber to binary ( decimal part)
to transform a number of the decimal system into the binary one, there are many ways:

1. the integer part is transformed to binary. 2.we continue with the decimal part, multiplying each number by 2. if the result is greater or equal to one we take note of it as a binary 1. if it´s less than one we toke note of it as a binary 0. (for example, using the number 12.6 we must multiply 0.6 by 2, and we have 1.2 as result, indicating that our result it´s a binary 1. we only take the integer part of the result) 3. after we have make all the multiplications, we put the numbers in their obtaining order.

examples:

code 0,3125 (decimal)  => 0,0111 (binary). Process: 0,3125 · 2 = 0,625 => 0 0,625 · 2 = 1,25  => 1 0,25   · 2 = 0,5   => 1

code code 2,438612 (decimal) => 10,011100 (binary) Proceso: 0,438612 · 2 = 0,877224 => 0 0,877224 · 2 = 1,754448 => 1  0,754448 · 2 = 1,508896 => 1  0,508896 · 2 = 1,017792 => 1  0,017792 · 2 = 0,035584 => 0  0,035584 · 2 = 0,071168 => 0
 * integer part => 2 (decimal)= 10 (binary)
 * decimal part:

(if you want more decimals, you can continue forever) code