converting int to double..need help!!!!!!!

 
ok, I must be really messed up.. I write:
int tt=37;
double eu=tt/10;
Comment(eu);
return(0);
and I get "3"
have I been up too late programming? shouldn't I get 3.7 ?
 
oldman:
ok, I must be really messed up.. I write:
int tt=37;
double eu=tt/10;
Comment(eu);
return(0);
and I get "3"
have I been up too late programming? shouldn't I get 3.7 ?


I would guess the compilation tries to preserve the most specific type cast, which makes the tt/10 expression result in 3, before it is made into a double 3.0. Try using tt/10.0 instead, which should make it a double-number division.
 
sonofagun!!! you were right!!!!!!!! thank you!
Reason: