[gameprogrammer] Re: floating-point-numbers
- From: Robbert de Groot <zekaric@xxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Sat, 1 Dec 2007 15:29:36 -0500 (EST)
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
- References:
- [gameprogrammer] floating-point-numbers
- From: Christoph Harder
Other related posts:
- » [gameprogrammer] floating-point-numbers
- » [gameprogrammer] Re: floating-point-numbers
- » [gameprogrammer] Re: floating-point-numbers
- » [gameprogrammer] Re: floating-point-numbers
- [gameprogrammer] floating-point-numbers
- From: Christoph Harder