Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: Trying to translate overflowing JS code to Perl

by syphilis (Archbishop)
on Nov 29, 2023 at 11:42 UTC ( [id://11155937]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Trying to translate overflowing JS code to Perl
in thread Trying to translate overflowing JS code to Perl

return unpack( "l", pack "L", ($value & 0xffffffff)))

For which finite numeric values do any of the following 3 renditions differ:
say unpack( "l", pack "L", ($value & 0xffffffff)); say unpack( "l", pack "L", ($value)); say unpack( "l", pack "l", ($value));
Sorry ... I'm not trying to be critical ... not even nitpicking ... but I haven't found any such values, and I'm genuinely curious as to whether they exist.)

Cheers,
Rob

Replies are listed 'Best First'.
Re^5: Trying to translate overflowing JS code to Perl
by Corion (Patriarch) on Nov 29, 2023 at 13:22 UTC

    Yeah - I wasn't sure either. Reconsidering, I think pack "L" and pack "l" both truncate the value to 32 bits already, so masking out higher bits does not make a difference.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-05-21 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found