Float vs Double
Cochrane Wrote:If you do
the finished program will load the number as a double and then convert it to a float, which is slower thanCode:
float foo = 2.0
where the number will be loaded directly as float.Code:
float foo = 2.0f
Well in cases like that, as long as you compile with optimizations on (i.e. release mode), any compiler worth its salt will precompute known constant conversions as far as possible at compile time.
And things are a bit complicated in the float/double world, this link explains things better than I can:
|Messages In This Thread|
Float vs Double - zKing - Dec 10, 2005 12:18 PM
Float vs Double - zKing - Dec 10, 2005, 04:29 PM
Float vs Double - zKing - Dec 12, 2005, 11:40 AM
Possibly Related Threads...
|float value changes when passed to function||kendric||5||3,127||
Nov 15, 2009 01:57 PM
Last Post: kendric