This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix test count in ext/XS-APItest/t/refs.t
[perl5.git] / ext / XS-APItest / numeric.xs
CommitLineData
ffe53d21
NC
1MODULE = XS::APItest PACKAGE = XS::APItest::numeric
2
3void
4grok_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)));