Mercurial > hg > CbC > old > device
comparison test/float.c @ 479:51c1b795b4f3
fix broken $gp in jal in code segement
author | kono |
---|---|
date | Sat, 26 Nov 2005 09:50:55 +0900 |
parents | f8ba383dbc39 |
children | a379da780856 |
comparison
equal
deleted
inserted
replaced
478:5e1acbe82483 | 479:51c1b795b4f3 |
---|---|
4 void print(double d); | 4 void print(double d); |
5 | 5 |
6 extern double sin(double); | 6 extern double sin(double); |
7 // extern float fsin(float); | 7 // extern float fsin(float); |
8 double test9(double f,int i); | 8 double test9(double f,int i); |
9 int test7(); | |
9 | 10 |
10 float f = 0.3; | 11 float f = 0.3; |
11 double d = 0.3; | 12 double d = 0.3; |
12 float f1 = 0.3; | 13 float f1 = 0.3; |
13 double d1 = 0.3; | 14 double d1 = 0.3; |
93 test1(1,2,3,10,11,4); | 94 test1(1,2,3,10,11,4); |
94 test2(1,2,3,10,11,4); | 95 test2(1,2,3,10,11,4); |
95 test3(1,2,3,10,11,4); | 96 test3(1,2,3,10,11,4); |
96 test4(1,2,3,10,11,4); | 97 test4(1,2,3,10,11,4); |
97 test5(1,2,3,10,11,4); | 98 test5(1,2,3,10,11,4); |
99 test7(); | |
98 | 100 |
99 g = 1.0; | 101 g = 1.0; |
100 g = -g; | 102 g = -g; |
101 printf("#0062:%d\ncond0 ",1); | 103 printf("#0062:%d\ncond0 ",1); |
102 if(f==f*1.0) printf("#0063:t "); | 104 if(f==f*1.0) printf("#0063:t "); |
386 g = f*2; | 388 g = f*2; |
387 h = f-0.5; | 389 h = f-0.5; |
388 return h/3-(3.0-(g+3)*test9(f*0.5,i-1)/(h-1)); | 390 return h/3-(3.0-(g+3)*test9(f*0.5,i-1)/(h-1)); |
389 } | 391 } |
390 | 392 |
391 | 393 struct huga0 { |
394 char c; | |
395 short s; | |
396 int i; | |
397 long l; | |
398 float f; | |
399 }; | |
400 struct huga { | |
401 char c; | |
402 short s; | |
403 int i; | |
404 long l; | |
405 float f; | |
406 struct huga0 hh; | |
407 }; | |
408 | |
409 | |
410 struct enemy{ | |
411 int charno; // image number | |
412 float x; // x location | |
413 float y; // y location | |
414 int ap; // armor point | |
415 }; | |
416 | |
417 void | |
418 print_param(struct enemy *e) | |
419 { | |
420 printf("charno:%d x,y:%f,%f hp:%d\n", | |
421 e->charno,e->x,e->y,e->ap); | |
422 } | |
423 | |
424 | |
425 int test7() | |
426 { | |
427 struct huga h; | |
428 struct enemy e; | |
429 | |
430 h.c = 10; | |
431 h.s = 20; | |
432 h.i = 30; | |
433 h.l = 40; | |
434 h.f = 50; | |
435 h.hh.c = 10; | |
436 h.hh.s = 20; | |
437 h.hh.i = 30; | |
438 h.hh.l = 40; | |
439 h.hh.f = 50; | |
440 | |
441 | |
442 e.charno=5; e.x=50.0; e.y=30.0; e.ap=100; | |
443 print_param(&e); | |
444 return (0); | |
445 } | |
446 |