Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   64 Bit integer display (http://www.velocityreviews.com/forums/t906840-64-bit-integer-display.html)

Deepu 03-20-2008 08:04 PM

64 Bit integer display
 
Hi All,

Can somebody give some ideas on how to display 64bit integer.

I tried,

#!/usr/bin/perl -w

use bigint;

$test = 0x123456789abcdef;

print "$test \n";

But when i run:

Hexadecimal number > 0xffffffff not portable

Thanks!


Joost Diepenmaat 03-20-2008 08:25 PM

Re: 64 Bit integer display
 
Deepu <pradeep.bg@gmail.com> writes:

> Hexadecimal number > 0xffffffff not portable


is that really the error you get? it works for every perl I've got on
linux that has bigint. (in my case, perls 5.8.5 ... 5.10 ) and I can't
find ANY reference to that error using google.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

Ben Morrow 03-20-2008 08:41 PM

Re: 64 Bit integer display
 

Quoth Deepu <pradeep.bg@gmail.com>:
>
> I tried,
>
> #!/usr/bin/perl -w
>
> use bigint;
>
> $test = 0x123456789abcdef;
>
> print "$test \n";
>
> But when i run:
>
> Hexadecimal number > 0xffffffff not portable


perldiag tells you this warning is in the 'portable' category. Since the
only warnings in this category are about integers greater than 2**32-1,
which you aren't interested in, simply turn them off:

use warnings;
use strict;

no warnings 'portable';
use bigint;

print 0x123456789abcdef;

At least on my perl (i386-freebsd-64int), I don't need 'bigint', since
despite being built for a 32-bit processor it can still use 64-bit
integers.

Ben



All times are GMT. The time now is 10:00 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57