Using Devel::Peek to look further into what is going on is more revealing:
#!/usr/local/bin/perl
use strict;
use Devel::Peek;
my $a = 4294967296;
my $b = 4294967295;
my $c = $a & $b;
print '$a:';Dump($a);
print '$b:';Dump($b);
print '$c:';Dump($c);
Results:
$a:SV = PVNV(0x1abe608) at 0x1ab30a0
REFCNT = 1
FLAGS = (PADBUSY,PADMY,IOK,NOK,pIOK,pNOK,IsUV)
UV = 4294967295
NV = 4294967296
PV = 0
$b:SV = IV(0x1ab2420) at 0x1ab3058
REFCNT = 1
FLAGS = (PADBUSY,PADMY,IOK,pIOK,IsUV)
UV = 4294967295
$c:SV = IV(0x1ab2428) at 0x1ab3088
REFCNT = 1
FLAGS = (PADBUSY,PADMY,IOK,pIOK,IsUV)
UV = 4294967295
4294967296 has overflowed the integers on the platform I am using, and is appearing as 0xFFFFFFFF.
Whether this is expected behaviour or not is maybe upto Larry or p5p.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.