Каков быстрый и простой способ упаковки знаковых значений в 4 бита? [закрыто] ⇐ Python
Каков быстрый и простой способ упаковки знаковых значений в 4 бита? [закрыто]
I have a python list of integers, each being in the range [-8,7]. I want to pack these values into an array of bytes that i will send down a socket connection. Since these values can be represented by 4 bits in a two's complement representation, it should be possible to pack two such values in each byte. What is a good and relatively fast way of doing this in python? Thanks
Источник: https://stackoverflow.com/questions/781 ... -in-4-bits
I have a python list of integers, each being in the range [-8,7]. I want to pack these values into an array of bytes that i will send down a socket connection. Since these values can be represented by 4 bits in a two's complement representation, it should be possible to pack two such values in each byte. What is a good and relatively fast way of doing this in python? Thanks
Источник: https://stackoverflow.com/questions/781 ... -in-4-bits
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Каков самый быстрый способ чтения позиций и индексов вершин в буфер из файла .obj? [закрыто]
Anonymous » » в форуме C++ - 0 Ответы
- 43 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Самый быстрый/самый быстрый способ конвертировать фреймы данных pandas в таблицы слов
Anonymous » » в форуме Python - 0 Ответы
- 57 Просмотры
-
Последнее сообщение Anonymous
-