I am working on project which includes usage of struct module and its pack/unpack functions with python3.6
I have referred to many articles like this one and have got the basic idea but I am not able to understand it for my use case.
For ex:
var = struct.pack('i',1)
print(var)
It gives output b'\x01\x00\x00\x00' which I can understand because we have mentioned int as format and thus output is of 4 bytes.
Now another example:
var = struct.pack('i', 1156888062)
Now in this case why is the output b'\xfe\xb5\xf4D'. Can anyone please explain this.
Also when I unpack it
print(struct.unpack('f', var))
How come the output is (1957.687255859375,)