i dont know if i coded it wrong. plus working properly but the /2.0 return 
always zero. good idea on >>1. gonna try that first. 
thanks :)

================================= 
http://www.svnstrk.blogspot.com  
=================================

--- On Thu, 5/14/09, John Matthews <[email protected]> wrote:

From: John Matthews <[email protected]>
Subject: [c-prog] Re: char to float to char
To: [email protected]
Date: Thursday, May 14, 2009, 2:16 AM











 






    
            
            


      
      --- In c-p...@yahoogroups. com, "mikejd42" <mikej...@.. .> wrote:

>

> --- In c-p...@yahoogroups. com, "John Matthews" <jm5678@> wrote:

> >

> >     newPixel = (pixel1 + pixel2) / 2;

> >

> instead of the "/2" use " >> 1" its faster with less overhead.



The compiler will generate code that effectively does >>1 to implement the /2 
(if it doesn't then time to change compilers). So I would argue that it's 
better to write it as /2 because logically that's what you want to do.




 

      

    
    
        
         
        
        


        


        
        
        
        
        




      

[Non-text portions of this message have been removed]

Reply via email to