Thank you haukex this is a good explanation.
In a sense am I being a little bit confused around what Devel:Peek is telling me, bearing in mind I am using a 5.14 version.
$n = unpack "C", pack "B", 128; &print_val; $n += $n; &print_val; #output #SV = IV(0xe28558) at 0xe2855c # REFCNT = 1 # FLAGS = (PADMY,IOK,pIOK) # IV = 128 # ### #SV = IV(0xe28558) at 0xe2855c # REFCNT = 1 # FLAGS = (PADMY,IOK,pIOK) # IV = 256 # ###
These are actually UV values then? but Perl is storing them as IV's. and the sum at the microprocessor level, adding 128 to itself, is carrying out a binary addition of a natural number.
I have only just found out about two's complement a couple of weeks ago, and I'm not sure where I stand on that just yet.
In reply to Re^4: Can I access and use UV types from perl?
by Don Coyote
in thread Can I access and use UV types from perl?
by Don Coyote
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |