Terry J. Reedy added the comment:
Jorge, next time you have questions about how to use a module (and struct is
fairly advanced), please ask on an appropriate forum, such as python-list.
Then Steven's nice answer could be read by 100s of people instead of likely
less than 10.
I looked as
Steven D'Aprano added the comment:
This is not a bug, and I'm unconvinced that it needs a documentation change. If
you are using struct to assemble values, you need to know the meaning of the
struct format.
It returns a float NAN because you give it the bit pattern of a NAN.
For C singles
New submission from Jorge Rojas :
Hi all!
I have this case when trying to get a float value applying pack to these
integer values:
struct.unpack('f', struct.pack('HH', 0, 32704))
This happens when executing the unpack function to a float format, from a
bit-array where the sign bit is not in