Click here to get back home

64 Bit integer display

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
64 Bit integer display Deepu 03-20-2008
Posted by Deepu on March 20, 2008, 4:04 pm
Please log in for more thread options
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!


Posted by Joost Diepenmaat on March 20, 2008, 4:25 pm
Please log in for more thread options

> 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/

Posted by Ben Morrow on March 20, 2008, 4:41 pm
Please log in for more thread options

>
> 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


Similar ThreadsPosted
char->integer, integer->char commands November 21, 2005, 10:24 am
0 + 1 not an integer? August 4, 2004, 7:56 am
integer fail ... July 28, 2005, 3:35 am
File::ReadBackwards, use integer April 23, 2005, 5:49 pm
Convert Integer value to IP Address July 21, 2005, 6:44 pm
Integer conversion and back again September 21, 2005, 4:53 pm
Perl Integer Length January 5, 2006, 1:53 pm
trying to generate integer from string April 25, 2007, 6:51 am
assembling a signed integer from bytes January 8, 2005, 1:54 pm
convert string with comma into an integer June 27, 2005, 4:00 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap