diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-13 00:53:47 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-13 00:53:47 +0200 |
| commit | cac7f3e868e98281f9f2b841101b09f02cf664fd (patch) | |
| tree | 7e83f551f4caa7f928742becdbc1dede5ec1b9fe /semestre 3/architecture des ordinateurs/1- Représentation de l'information.md | |
| parent | 11d5e7431489b8b40cf479a7f88c171d6fbf77a7 (diff) | |
Ajout du scripts bin_to_hex
Diffstat (limited to 'semestre 3/architecture des ordinateurs/1- Représentation de l'information.md')
| -rw-r--r-- | semestre 3/architecture des ordinateurs/1- Représentation de l'information.md | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/semestre 3/architecture des ordinateurs/1- Représentation de l'information.md b/semestre 3/architecture des ordinateurs/1- Représentation de l'information.md index 9545578..ee2a51c 100644 --- a/semestre 3/architecture des ordinateurs/1- Représentation de l'information.md +++ b/semestre 3/architecture des ordinateurs/1- Représentation de l'information.md @@ -240,21 +240,7 @@ def bin_to_hex(b): return hex ``` -```elixir -def bin_to_hex(b) do - bin_to_hex_rec(b, []) -end - -defp bin_to_hex_rec(before, after) when before != "" do - {b, a} = String.split_at(before, -4) - #TODO: convert algo - bin_to_hex_rec(b, [a | after]) -end - -defp bin_to_hex_rec("", after) do - after -end -``` +Voir le dossier `scripts` pour la version elixir. Pour réaliser une addition en binaire, on a besoin que les deux mots fassent la même taille @@ -290,4 +276,4 @@ $$ = \mathrm{0b}1\ldots1 = -1 $$ Donc, on a que $\bar N$ doit être décalé de 1, d'où le plus 1 |> cela est dû au fait que l'intervalle ne soit pas symétrique -Voir le moodle pour la suite
\ No newline at end of file +Voir le moodle pour la suite |
