- or download this
SV *
overload_add_eq (a, b, third)
...
CODE:
RETVAL = overload_add_eq (aTHX_ a, b, third);
OUTPUT: RETVAL
- or download this
void
overload_add_eq (a, b, third)
...
CODE:
overload_add_eq (aTHX_ a, b, third);
XSRETURN_EMPTY; /* return empty stack */
- or download this
SV * overload_add_eq(pTHX_ SV * a, SV * b, SV * third) {
/* lengthy code snipped */
}
- or download this
void overload_add_eq(pTHX_ SV * a, SV * b, SV * third) {
PERL_UNUSED_ARG(third); /* UPDATE: This line can be removed as ir
+relevant */
mpz_add_ui(*(INT2PTR(mpz_t *, SvIVX(SvRV(a)))), *(INT2PTR(mpz_t *
+, SvIVX(SvRV(a)))), SvUV(b));
}
- or download this
> perl -Mblib -MMath::GMPz -MDevel::Peek -wle "$x = Math::GMPz->new(12
+34); $x++;print $x; $x += 15; print $x; Dump($x);"
1235
...
FLAGS = ()
IV = 1837594613288
PV = 0
- or download this
> perl -Mblib -MMath::GMPz -MDevel::Peek -wle "$x = Math::GMPz->new(12
+34); $x++; print $x; Math::GMPz::overload_add_eq($x, 15, 0); print $x
+;"
1235
1250
- or download this
> perl -Mblib -MMath::GMPz -MDevel::Peek -wle "$x = Math::GMPz->new(12
+34); $x++;print $x; $x += 15; print $x; Dump($x);"
1235
...
NV = 0
PV = 0
STASH = 0x2bfffa5e5e8 "Math::GMPz"