Commit | Line | Data |
3e61d65a |
1 | #include "EXTERN.h" |
2 | #include "perl.h" |
3 | #include "XSUB.h" |
4 | |
5 | MODULE = XS::APItest PACKAGE = XS::APItest |
6 | |
7 | PROTOTYPES: DISABLE |
8 | |
9 | void |
10 | print_double(val) |
11 | double val |
12 | CODE: |
13 | printf("%5.3f\n",val); |
14 | |
15 | int |
16 | have_long_double() |
17 | CODE: |
18 | #ifdef HAS_LONG_DOUBLE |
19 | RETVAL = 1; |
20 | #else |
21 | RETVAL = 0; |
22 | #endif |
23 | |
24 | void |
25 | print_long_double() |
26 | CODE: |
27 | #ifdef HAS_LONG_DOUBLE |
fc0bf671 |
28 | # if defined(PERL_PRIfldbl) && (LONG_DOUBLESIZE > DOUBLESIZE) |
3e61d65a |
29 | long double val = 7.0; |
30 | printf("%5.3" PERL_PRIfldbl "\n",val); |
31 | # else |
32 | double val = 7.0; |
33 | printf("%5.3f\n",val); |
34 | # endif |
35 | #endif |
36 | |
37 | void |
3e61d65a |
38 | print_int(val) |
39 | int val |
40 | CODE: |
41 | printf("%d\n",val); |
42 | |
43 | void |
44 | print_long(val) |
45 | long val |
46 | CODE: |
47 | printf("%ld\n",val); |
48 | |
49 | void |
50 | print_float(val) |
51 | float val |
52 | CODE: |
53 | printf("%5.3f\n",val); |