Using 64-bit ints when "~0" is 32 bits

D

david.karr

I have a perl script that I want to run on Cygwin and Solaris. When I
run it on Cygwin, the value of ~0 is 64 bits long. When I run it on
Solaris, it's only 32 bits. I need the script to work the same way on
both platforms. It's not likely to be practical for me to rebuild the
Perl on Solaris to run in 64 bits, so what are my options for getting
this working? The perl versions on both platforms are different.
Cygwin is running v5.8.7, and Solaris is running v5.6.1.
 
D

david.karr

david.karr said:
I have a perl script that I want to run on Cygwin and Solaris. When I
run it on Cygwin, the value of ~0 is 64 bits long. When I run it on
Solaris, it's only 32 bits. I need the script to work the same way on
both platforms. It's not likely to be practical for me to rebuild the
Perl on Solaris to run in 64 bits, so what are my options for getting
this working? The perl versions on both platforms are different.
Cygwin is running v5.8.7, and Solaris is running v5.6.1.

Ok, I've mostly answered this for myself, to use Math::BigInt. I've
got it mostly working. One minor annoyance I noticed is that when I
print BigInts on Windows, it just shows digits, but when I print them
on Solaris, they have a "+" sign on the front. Is there an easy way to
make them not show the "+" sign?
 
D

david.karr

david.karr said:
Ok, I've mostly answered this for myself, to use Math::BigInt. I've
got it mostly working. One minor annoyance I noticed is that when I
print BigInts on Windows, it just shows digits, but when I print them
on Solaris, they have a "+" sign on the front. Is there an easy way to
make them not show the "+" sign?

Oh, never mind. Just installing the latest version of Math::BigInt
(1.77, the same as on Windows) makes the Solaris version behave the
same as the Windows one.

I'll shut up for a while :) .
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top