Think about Loose Coupling | |
PerlMonks |
Re^4: Float/double to hex?by edwyr (Sexton) |
on Feb 19, 2013 at 22:03 UTC ( [id://1019670]=note: print w/replies, xml ) | Need Help?? |
Here is what I am looking for (running inside "perl -d -e 1"):
x 2**16
65536
x unpack('h*', pack('i', 65535))
'ffff0000'
$x = 1 / 7
x $x
0.142857142857143
x unpack('h*', pack('f', $x))
'529421e3'
In Section
Seekers of Perl Wisdom
|
|