Subject: | dualvar, 1<<31 and 5.6.0 on OS X. |
Tests #8 and 9 of dualvar.t is failing with the stock Perl 5.6.0 on OS X. dumpvar(1<<31,..) is coming out as -2147483648 in numeric context instead of 2147483648. Oddly enough, it works fine if you change it to 2**31.
This seems to be an OS X issue, not a 5.6.0 issue, as it dualvar(1<<31,...) works fine with 5.6.0 on Linux/x86. It also works fine with 5.8.0 on OS X built from source.
It seems 1<<31 and 2**31 produce subtly different scalars. This information may prove useful:
$ perl5.6.0 -wle 'print 1<<31; print 2**31'
2147483648
2147483648
$ perl5.8.0 -wle 'print 1<<31+0; print 2**31'
2147483648
2147483648
$ perl5.6.0 -MDevel::Peek -wle 'print Dump 1<<31; print Dump 2**31'
SV = IV(0x10278) at 0x14748
REFCNT = 1
FLAGS = (IOK,READONLY,pIOK,IsUV)
UV = 2147483648
SV = PVNV(0x7338) at 0x6650
REFCNT = 1
FLAGS = (NOK,READONLY,pNOK)
IV = -2147483648
NV = 2147483648
PV = 0
$ perl5.8.0 -MDevel::Peek -wle 'print Dump 1<<31; print Dump 2**31'
SV = IV(0x1389c) at 0x11948
REFCNT = 1
FLAGS = (IOK,READONLY,pIOK)
IV = 2147483648
SV = PVNV(0x2b6e8) at 0x768c
REFCNT = 1
FLAGS = (IOK,NOK,READONLY,pIOK,pNOK)
IV = 2147483648
NV = 2147483648
PV = 0