Added a test for casts
This commit is contained in:
parent
a8703841b2
commit
d98394f0cf
|
@ -99,6 +99,11 @@ t1() {
|
|||
printf("\t\t\t\t\tfloat %f\n",f) ;
|
||||
#endif
|
||||
|
||||
printf("Casts from long\n");
|
||||
l = 75000;
|
||||
printf("\tchar %5d, int %d, unsigned short %6o, long %11ld\n",
|
||||
(char) l,(int) l,(unsigned short)l ,l) ;
|
||||
|
||||
#ifndef NOFLOAT
|
||||
printf("From float\n") ;
|
||||
f = 121.5 ;
|
||||
|
|
|
@ -21,6 +21,8 @@ From integer
|
|||
From long
|
||||
char -3, int -3, unsigned 37777777775, long -3
|
||||
float -3.000000
|
||||
Casts from long
|
||||
char -8, int 75000, unsigned short 22370, long 75000
|
||||
From float
|
||||
char 121, int 121, unsigned 171, long 121, float 121.500000
|
||||
char 0, int 0, unsigned 0, long 0, float 0.000100
|
||||
|
|
Loading…
Reference in a new issue