64 Bit integer display

D

Deepu

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

Joost Diepenmaat

Deepu said:
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.
 
B

Ben Morrow

Quoth Deepu said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top