in reply to How to portably determine integer limits?

# Largest unsigned integer. print ~0; # The largest signed integer print +(~0)>>1; # Smallest signed integer. $n = (~0)>>1; print do{ use integer; ~$n };

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!

Replies are listed 'Best First'.
Re: How to portably determine integer limits? (simpler)
by tye (Sage) on Oct 30, 2003 at 16:16 UTC

    Somewhat simpler versions of the last two are ~0>>1 and -(~0>>1)-1.

                    - tye