On 12/27/05, Alon Marx <[EMAIL PROTECTED]> wrote:
> Is there a constant or a definition for a maximum number in perl? And
> the same question for a minimum value?

This may work for you

the biggest unsigned integer

$ perl -e 'print ~0'
18446744073709551615 # 64-bit integers

the maximum signed integer

$ perl -MConfig -e 'print( (1<<$Config{ivsize}*8-1)-1 )'
9223372036854775807

the minimum signed integer

$ perl -MConfig -e 'print -(1<<$Config{ivsize}*8-1)'
-9223372036854775808

I am not sure how general these expressions are. The illustrated
values are for 64bit integers.

Adriano.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to