I've got some javascript I need to rewrite in Perl and I'm stuck on the javascript >> operator which I believe is sign-propagating right bitwise shift. I found this node and it looked promising but none of the suggestions work for me.
I was thinking it may be because my ivsize is 8. Anyway, here are some examples from javascript of numbers shifted right 8 bits:
-1 >> 8 = -1 2140837940 >> 8 = 8362648 -1934825877 >> 8 = -7557914 -2004116368 >> 8 = -7828580 1978483312 >> 8 = 7728450 -293893010 >> 8 = -1148020
I cannot seem to reproduce this in Perl. Any ideas?
javascript >> operatorEDIT: added link to Javascript docs
In reply to reproducing javascripts >> operator by mje
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |