Re: integer to binary...
nicolasg@gmail. com a écrit :[color=blue]
> does anyone know a module or something to convert numbers like integer
> to binary format ?
>
> for example I want to convert number 7 to 0111 so I can make some
> bitwise operations...[/color]
You don't need to convert anything. The bitwise ops are &, |, <<, >>
0 | 2 | 4
-> 6
6 & 2
-> 2
2 << 4
-> 32
8 >> 1
-> 4
nicolasg@gmail. com a écrit :[color=blue]
> does anyone know a module or something to convert numbers like integer
> to binary format ?
>
> for example I want to convert number 7 to 0111 so I can make some
> bitwise operations...[/color]
You don't need to convert anything. The bitwise ops are &, |, <<, >>
0 | 2 | 4
-> 6
6 & 2
-> 2
2 << 4
-> 32
8 >> 1
-> 4
Comment