[gameprogrammer] Re: floating-point-numbers

Some programmers (Hi) up the warning level and to avoid compiler
warnings, these programmers will use 1.0f or (float) 1 to get rid of
those annoying "warning, conversion from int to float, possible loss
of precision" messages.

--- Christoph Harder <shadowomf@xxxxxxxx> wrote:

> Hello,
> 
> can anybody tell me why many OpenGL programmer user "1.0f" instead
> of 
> just "1"?
> for example glVertex3f(1.0f, 1.5f, 0.0f); instead of glVertex3f(1,
> 1.5, 0);
> Is there any performance advantage or something? The compiler
> should 
> recognize that the function needs 3 floats or not?
> Or is it just some strange coding style?
> 
> Thanks in advance.
>     Christoph
> 
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> 
> 
> 


Robbert de Groot


      Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: