This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert t/re/subst_amp.t to test.pl, strict and warnings.
[perl5.git] / ext / XS-APItest / numeric.xs
1 MODULE = XS::APItest            PACKAGE = XS::APItest::numeric
2
3 void
4 grok_number(number)
5         SV *number
6     PREINIT:
7         STRLEN len;
8         const char *pv = SvPV(number, len);
9         UV value;
10         int result;
11     PPCODE:
12         EXTEND(SP,2);
13         result = grok_number(pv, len, &value);
14         PUSHs(sv_2mortal(newSViv(result)));
15         if (result & IS_NUMBER_IN_UV)
16             PUSHs(sv_2mortal(newSVuv(value)));