decibinary.py

Created by camil-kdr

Created on December 15, 2020

540 Bytes


BINARY - DECIMAL
2^9|2^8|2^7|2^6|2^5|2^4|2^3|2^2|2^1|2^0
   |   |   |   |   |   |   |   |   |
   | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1
   |   |   |   |   |   |   |   |   |
   |   |   |   |   |   |   |   |   |

Binary --> Decimal
ex: 100110001 = 19530
1*2^0 + 1*2^4 + 1*2^5 + 1*2^8 

Decimal --> Binary
diviser par 2 chaque terme:
s'il y a un reste : 1 sinon 0
lire à l'envers le resultat!! 
ex: 29 = 11101
29/2 = 14 reste? oui = 1
14/2 = 7 reste? non = 0
7/2 = 3 reste? oui = 1
3/2 = 1 reste? oui = 1
1/2 = 0 reste? oui = 1

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.