-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unpack('N', pack('N', -1)) not idempotent #802
Comments
From ben@mucus.advanced.org# Sample program demonstrating that unpack('N', pack('N', -1)) is # Uncommeting this fixes the problem # Uncommenting this does not fix the problem print "unpack('N', pack('N', $startVal)) is $endVal which is "; Perl Info
|
From [Unknown Contact. See original ticket]Ben Teitelbaum <ben@mucus.advanced.org> wrote
The pack type 'N' (and also 'n', 'v' and 'V') is unsigned. The Patch (for perl5.005_62) attached. Mike Guy Inline Patch--- ./pod/perlfunc.pod.orig Tue Nov 2 21:32:06 1999
+++ ./pod/perlfunc.pod Tue Nov 2 21:33:20 1999
@@ -2769,10 +2769,10 @@
what a local C compiler calls 'long'. If you want
native-length longs, use the '!' suffix.)
- n A short in "network" (big-endian) order.
- N A long in "network" (big-endian) order.
- v A short in "VAX" (little-endian) order.
- V A long in "VAX" (little-endian) order.
+ n An unsigned short in "network" (big-endian) order.
+ N An unsigned long in "network" (big-endian) order.
+ v An unsigned short in "VAX" (little-endian) order.
+ V An unsigned long in "VAX" (little-endian) order.
(These 'shorts' and 'longs' are _exactly_ 16 bits and
_exactly_ 32 bits, respectively.)
@@ -2934,7 +2934,7 @@
0x12 0x34 0x56 0x78 # little-endian
0x78 0x56 0x34 0x12 # big-endian
-Basically, the Intel, Alpha, and VAX CPUs and little-endian, while
+Basically, the Intel, Alpha, and VAX CPUs are little-endian, while
everybody else, for example Motorola m68k/88k, PPC, Sparc, HP PA,
Power, and Cray are big-endian. MIPS can be either: Digital used it
in little-endian mode; SGI uses it in big-endian mode.
End of patch |
From [Unknown Contact. See original ticket]On Tue, Nov 02, 1999 at 09:36:00PM +0000, mjtg@cus.cam.ac.uk wrote:
Oh thanks! I too got bitten my that recently. -- |
From @jhiJoshua N Pritikin writes:
This patch is also already in the 63-to-be. -- |
Migrated from rt.perl.org#1729 (status was 'resolved')
Searchable as RT1729$
The text was updated successfully, but these errors were encountered: