in reply to XS and -Duse64bitint
You could add an explicit conversion to IV, e.g.
... char * str; sv_setiv(integer, SvIV(integer)); // <--- here str = SvPV_nolen(integer); ...
However, when doing that, I get (note the difference in the last two digits):
IV: 144115188075868217 IV: 144115188075868224
I suppose this is due to the insufficient precision in the NV representation... Actually, I think it's too late to deal with this within your XS routine, as the value will already have been converted to NV when the SV gets passed to foo() - unless you use integer on the Perl side (but you already figured that out :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XS and -Duse64bitint
by syphilis (Archbishop) on Feb 13, 2007 at 23:00 UTC |