in reply to Re^3: Can I access and use UV types from perl?
in thread Can I access and use UV types from perl?
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Can I access and use UV types from perl?
by haukex (Archbishop) on Nov 17, 2019 at 21:58 UTC | |
by ikegami (Patriarch) on Nov 18, 2019 at 16:05 UTC | |
by Don Coyote (Hermit) on Nov 17, 2019 at 22:46 UTC | |
by haukex (Archbishop) on Nov 17, 2019 at 23:39 UTC | |
by Don Coyote (Hermit) on Nov 18, 2019 at 00:52 UTC | |
by dave_the_m (Monsignor) on Nov 18, 2019 at 09:24 UTC | |
|
In Section
Seekers of Perl Wisdom