Thread 2byte signed Integer zusammensetzen (18 answers)
Opened by monti at 2015-01-06 11:28

rosti
 2015-01-06 11:39
#179075 #179075
User since
2011-03-19
3492 Artikel
BenutzerIn
[Homepage]
user image
Nimm doch einfach die pack()-Schablone "s" (kleines s steht für A signed short (16-bit) value)

Code (perl): (dl )
1
2
my $bytes = pack "s", -12345;
print unpack "s", $bytes;

View full thread 2byte signed Integer zusammensetzen