Arithmetic operators and function calling in C
        Posted  
        
            by Robert Dalton
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Robert Dalton
        
        
        
        Published on 2010-05-26T01:05:07Z
        Indexed on 
            2010/05/26
            1:11 UTC
        
        
        Read the original article
        Hit count: 349
        
I'm not quite sure why I can't do
double a = (float) my_Function(45) / 2048 / 2340 / 90;
printf("%.4",a); // prints out 0.00
But instead I have to use one more variable as:
double a = (float) my_Function(45);
double b = (float) a  / 2048 / 2340 / 90;
printf("%.4",b);  // prints out the correct value
© Stack Overflow or respective owner