Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Difference between Perl and Java for << operator?

by syphilis (Archbishop)
on Jul 31, 2021 at 10:25 UTC ( [id://11135542]=note: print w/replies, xml ) Need Help??


in reply to Re: Difference between Perl and Java for << operator?
in thread Difference between Perl and Java for << operator?

Note also, that your << 28 assumes that your perl is compiled for 32-bit integers

Well spotted - if you want to use the perl sub that the OP provided then:
1) you will need to be running under the use integer pragma;
and
2) you will also need to be running a perl that was built with 32-bit integers.

However, as has also been demonstrated, there are ways to obtain the desired result by doing a 0xFFFFFFFF << 28, that will work on both 32-bit integer and 64-bit integer builds.

Cheers,
Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135542]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-25 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found