File: Numeric.xs

package info (click to toggle)
libscalar-util-numeric-perl 0.02-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 196 kB
  • ctags: 433
  • sloc: perl: 59; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 407 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"

MODULE = Scalar::Util::Numeric		PACKAGE = Scalar::Util::Numeric		

void
is_num(sv)
    SV *sv
    PROTOTYPE: $
    PREINIT:
    I32 num = 0;
    CODE:

    if (!(SvROK(sv) || (sv == (SV *)&PL_sv_undef))) {
		num = looks_like_number(sv);
    }

    XSRETURN_IV(num);

void
uvmax()
    PROTOTYPE:
    CODE:
    XSRETURN_UV(UV_MAX);