Blog

64bit perl

You might think your perl is ‘compiled 64bit’, but is it really planning on using 64bit integer scalars?

integer bits:
perl -MConfig -e 'print $Config{ivsize}*8'

largest integer:
perl -e 'print ~0'

largest signed integer:
perl -MConfig -e 'print( (1<<$Config{ivsize}*8-1)-1 )'

smallest signed integer:
perl -MConfig -e 'print -(1<<$Config{ivsize}*8-1)'

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment replies are not available offline