in reply to Re^5: Trying to translate overflowing JS code to Perl
in thread Trying to translate overflowing JS code to Perl
The test's expected value is what JS outputs (therefore what I expect if I want to simulate JS behaviour)
I missed that - more likely through my inattention to detail, than anything else.
I had also missed that the unpack/pack approach also fails with the same values.
The integer pragma on a 32-bit perl seemed pretty good, but it fails to emulate on some expressions.
For example, the expression 1073741824+1073741824 needs to be evaluated outside the integer pragma, whereas the expression 1169367104 << 5 needs to be evaluated inside the integer pragma.
Cheers,
Rob