4 int float_test(
int n,
float f1,
float f2,
float f3,
float f4) {
8 ui = *((
unsigned int *)(&f1));
9 printf(
"%d: %8.8e %X\n", n, f1, ui);
10 ui = *((
unsigned int *)(&f2));
11 printf(
"%d: %8.8e %X\n", n, f2, ui);
12 ui = *((
unsigned int *)(&f3));
13 printf(
"%d: %8.8e %X\n", n, f3, ui);
14 ui = *((
unsigned int *)(&f4));
15 printf(
"%d: %8.8e %X\n", n, f4, ui);
20 int double_test(
long n,
double d1,
double d2,
double d3,
double d4) {
24 ul = *((
unsigned long *)(&d1));
25 printf(
"%ld: %16.16e %lX\n", n, d1, ul);
26 ul = *((
unsigned long *)(&d2));
27 printf(
"%ld: %16.16e %lX\n", n, d2, ul);
28 ul = *((
unsigned long *)(&d3));
29 printf(
"%ld: %16.16e %lX\n", n, d3, ul);
30 ul = *((
unsigned long *)(&d4));
31 printf(
"%ld: %16.16e %lX\n", n, d4, ul);
39 printf(
"size = %d\n", n);
41 ui = (
unsigned int *)(&(src[i]));
42 printf(
"%d: %d %X\n", i, src[i], *ui);
50 printf(
"size = %d\n", n);
52 ul = (
unsigned long *)(&(src[i]));
53 printf(
"%d: %ld %lX\n", i, src[i], *ul);
61 printf(
"size = %d\n", n);
63 ui = (
unsigned int *)(&(src[i]));
64 printf(
"%d: %e %X\n", i, src[i], *ui);
72 printf(
"size = %d\n", n);
74 ul = (
unsigned long *)(&(src[i]));
75 printf(
"%d: %e %lX\n", i, src[i], *ul);
82 printf(
"size = %d\n", n);
84 printf(
"%d: %c %x\n", i, src[i], src[i]);
90 printf(
"long = %ld(%lX)\n",l,l);
91 printf(
"int = %d(%X)\n",i,i);
92 printf(
"short = %d(%X)\n",s,s);
98 float ret = (float) (a + b);
100 ui = (
unsigned int *)&ret;
101 printf(
"// return %e, %X\n", ret, *ui);
106 double ret = (a + b);
108 ul = (
unsigned long *)&ret;
109 printf(
"// return %e, %lX\n", ret, *ul);
116 ul = (
unsigned long *)&ret;
117 printf(
"// return %ld, %lX\n", ret, *ul);
122 long i3,
long i4,
long i5,
123 double d0,
double d1,
double d2,
double d3,
124 double d4,
double d5,
double d6,
double d7,
125 double d8,
double d9,
127 printf(
"%ld %ld %ld\n", i0, i1, i2);
128 printf(
"%ld %ld %ld\n", i3, i4, i5);
131 printf(
"%lf %lf %lf %lf\n", d0, d1, d2, d3);
132 printf(
"%lf %lf %lf %lf\n", d4, d5, d6, d7);
133 printf(
"%lf %lf\n", d8, d9);
134 printf(
"%ld %ld\n", i6, i7);
140 long i3,
long i4,
long i5,
141 double d0,
double d1,
double d2,
double d3,
142 double d4,
double d5,
double d6,
double d7,
143 double d8,
double d9,
double d10,
145 printf(
"%ld %ld %ld\n", i0, i1, i2);
146 printf(
"%ld %ld %ld\n", i3, i4, i5);
149 printf(
"%lf %lf %lf %lf\n", d0, d1, d2, d3);
150 printf(
"%lf %lf %lf %lf\n", d4, d5, d6, d7);
151 printf(
"%lf %lf %lf\n", d8, d9, d10);
152 printf(
"%ld %ld\n", i6, i7);
159 static double (*
gf) (
long i0,
long i1,
long i2,
160 long i3,
long i4,
long i5,
161 double d0,
double d1,
double d2,
double d3,
162 double d4,
double d5,
double d6,
double d7,
163 double d8,
double d9,
169 printf(
"set_ifunc, g = %lX\n",
g);
174 gf = (double (*) (
long i0,
long i1,
long i2,
175 long i3,
long i4,
long i5,
176 double d0,
double d1,
double d2,
double d3,
177 double d4,
double d5,
double d6,
double d7,
178 double d8,
double d9,
180 printf(
"set_ffunc, gf = %lX\n",
gf);
184 printf(
"call_ifunc, g = %lX\n",
g);
189 printf(
"call_ffunc, gf = %lX\n",
gf);
190 return gf(100,101,102,
192 1000.0, 1010.0, 1020.0, 1030.0,
193 1040.0, 1050.0, 1060.0, 1070.0,
199 return (
sizeof(
void *));
203 return (
sizeof(
float));
207 return (
sizeof(
double));
211 return (
sizeof(
long));
215 return (
sizeof(
int));
int int_test(long l, int i, short s)
long ret_long(long a, long b)
long get_size_of_pointer()
float ret_float(double a, double b)
int lv_test(int n, long *src)
long set_ifunc(long(*f)())
double test_testd(long i0, long i1, long i2, long i3, long i4, long i5, double d0, double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, long i6, long i7)
int str_test(int n, char *src)
double ret_double(double a, double b)
int float_test(int n, float f1, float f2, float f3, float f4)
long get_size_of_float32()
double test_testd2(long i0, long i1, long i2, long i3, long i4, long i5, double d0, double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10, long i6, long i7)
int double_test(long n, double d1, double d2, double d3, double d4)
int iv_test(int n, int *src)
long get_size_of_double()
long set_ffunc(double(*f)())
static double(* gf)(long i0, long i1, long i2, long i3, long i4, long i5, double d0, double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, long i6, long i7)
int dv_test(int n, double *src)
int fv_test(int n, float *src)