----- Original Message ----- From: "William S Fulton" <[EMAIL PROTECTED]>
.
.
If I have an unsigned long long number in Perl:

$num = 9234567890121111113;
print "num from perl: " . $num;

On a 32 bit Linux system I get:

num from perl: 2.34567890121111e+17

and in C code, I have:

   SV* obj;
   ...
   const char *nptr = SvPV(obj, PL_na);

then displaying nptr, I also get the scientific representation in the string. This means I cannot use strtoull to convert to an unsigned long long. Any portable solutions for extracting the unsigned long long number?

But if you do:

$num = "9234567890121111113";

and then pass $num to the XSub, you should find that nptr contains the string "9234567890121111113" which you *can* convert using strtoull.

Going the other way, unsigned long longs would also be returned from the XSub to perl as a *string*.

I'm not sure that this achieves anything in the way of portability, however ...

Cheers,
Rob

Reply via email to