unsigned ints and overflow
am 05.03.2006 12:40:26 von fritz-bayerHi,
is there any way how I can use unsigned integers for a variable in
perl?
Fritz
Hi,
is there any way how I can use unsigned integers for a variable in
perl?
Fritz
fritz-bayer@web.de writes:
> Hi,
>
> is there any way how I can use unsigned integers for a variable in
> perl?
Perl-intern passiert das automatisch, wenn ein Wert für einen signed
int zu groß wäre:
perl5.8.8 -MDevel::Peek -e '$x=2**31-1; Dump $x; $x++; Dump $x'
SV = IV(0x813b8d0) at 0x811dda8
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 2147483647
SV = IV(0x813b8d0) at 0x811dda8
REFCNT = 1
FLAGS = (IOK,pIOK,IsUV)
UV = 2147483648
Ein IV ist ein signed int, ein UV (zusammen mit dem Flag IsUV) zeigt
ein unsigned int an.
Gruß,
Slaven
--
Slaven Rezic - slaven
tktimex - time recording tool
http://sourceforge.net/projects/ptktools/