[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Bitwise not operator.



Tim Howland writes:

>I've just been trying to do netmask manipulation in MacPerl (5.03r1m)
>There appear to be problems with the bitwise not of certain numbers,
>Specifically, accorind to macperl :-
>
>~ffffff00 is 7fffffff
>and
>~7fffffff is 80000000 (which is correct.)
>
>Is there something strange going on here to do with the handling
>of signed quantities and coversions? It would be nice if Perl
>behaved as expected :-)

I must apologise that my previous comment was well off the point. Anyhow it
seems to have gone to the military:

Received: from err.ethz.ch by WRSMTP-CCMAIL.ARMY.MIL (SMTPLINK V2.11)
        ; Fri, 30 Aug 96 09:35:24 EST

so maybe no-one saw it.

However:

        sprintf "%08x", ~hex("7FFFFFFF") returns 80000000
        sprintf "%08x", ~hex("FFFFFF00") returns 000000FF

both of which are correct I think?

Alan Fry