NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
That implies... (Score:2)
...that you're trying to move a long long between C and Perl. Do you need to do that? Can't the long longs just live inside the C?
It's probably not too hard to write the code to thunk between long long and Math::BigInt - would that help?
Reply to This
Re: (Score:2)
I don't know since my C and XS skills are so poor. The relevant bit of XS code is this:
Re: (Score:2)
If you're prepared to limit the input to 32 bit integers you can probably just change the
long longtolongin the prototype of Miller(). It should still uselong longinternally.To be more strictly correct you could use the output of
as the type of that argument. That will be
longfor 32 bit Perl andlong longfor 64 bit Perl.And if you want to be really sneaky write a version that bypasses XS type mapping and correctly handles Math::BigInt objects :)
Re: (Score:2)
Or, am I missing a point?
Re: (Score:2)
No, I think you're quite right :)
This little program:
prints 53.
So Ovid - make that argument a double and then cast it to a long long inside the function.
Re: (Score:1)
Then your XS looks like:
and the Miller function becomes
Caveat: obviously, if you put something other than a number in p_as_str, things will go awry. Also, different platforms (e.
Re: (Score:1)