Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Determining the length of "long"?



On Sep 13, 12:42am, Dominik Vogt wrote:
} Subject: Re: Determining the length of "long"?
}
} To clarify, on s390 (1 << 31) has the same result as (1 << 63) *if*
} the integer type is long (which I doubt, zsh probably uses long
} long).

Indeed, I wasn't aware (more accurately, forgot) that s390 has those
oddball 31-bit integers.

} The underlying assumption of the test that shifting an integer
} value to the left by its width in bits or more yields zero is
} wrong on some platforms.

That's not the underlying assumption, acctually.  The assumption is
that shifting by (number of bits minus one) will yield a very long
binary number (the ${#:-"..."} in the test: lots of trailing zeroes),
whereas shifting by the number of bits or more yields a number with a 
smaller footprint because multiple leading zeroes are not printed.



Messages sorted by: Reverse Date, Date, Thread, Author