Python: convert 2 ints to 32 float

Posted by bugspy.net on Stack Overflow See other posts from Stack Overflow or by bugspy.net
Published on 2010-06-17T15:25:58Z Indexed on 2010/06/17 15:33 UTC
Read the original article Hit count: 137

Filed under:

How can I combine 2 ints to a single 32bit IEEE floating point ? (each of the 2 ints represent 16 bit) And in the opposite direction: How can I transform a python float into 2 16 bit ints?

(I need this because of modbus protocol - where 2x16 bit registers are treated as single 32 floating point number)

© Stack Overflow or respective owner

Related posts about python