in reply to Re^8: Why is pack("N",42949672965) giving me 00 00 00 05
in thread Why is pack("N",42949672965) giving me 00 00 00 05

ikegami most probably wants to point out the fact that, with a 'Q' specifier, 0xFFFF_FFFF will give a different result.

While you are certainly right that for "all F's" it is easier to write "one short of overflow", hence "-1", he is certainly right in pointing out that simply going from 0xFFFF_FFFF to 0xFFFF_FFFF_FFFF_FFFF may be an incorrect oversimplification.

Replies are listed 'Best First'.
Re^10: Why is pack("N",42949672965) giving me 00 00 00 05
by BrowserUk (Patriarch) on Feb 10, 2015 at 07:54 UTC
    ikegami most probably wants to point out the fact that, with a 'Q' specifier, 0xFFFF_FFFF will give a different result.

    Hm. But that isn't what he said!

    What he said was: "your very question demonstrates that -1 and 0xFFFF_FFFF pack differently.". Which is patently and demonstrably wrong.

    And I don't see any mention of using OxFFFF_FFFF in conjunction with the Q specifier in Tux post.

    Indeed Tux didn't use, nor advocate the use of 0xFFFF_FFFF at all. The whole point of his post was: "Why not simply use -1?" which he demonstrated did the right thing with both 'N' & 'Q'.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked