[epiar-devel] 0.9 vs 0.9f
Chris Walton
chris.r.walton at gmail.com
Mon Feb 22 00:01:24 PST 2010
... which reminds me of another thing - should the Coordinate class be
using doubles internally as it is now, or shouldn't it rather be using
floats?
On Mon, Feb 22, 2010 at 8:59 AM, Matthew Zweig <thezweig at gmail.com> wrote:
> With GCC using 0.9 will not create a float even in an expression that will clearly only use floats. This means that at runtime, the 0.9 gets converted from a double to a float every time that code is run. Most of the time it doesn't matter, but it does make a difference in code areas that are used often. When I was trying to find optimization points (when afont was killing my computer), the performance tool Shark pointed out several implicit double to float conversions that were noticeably hurting my performance.
>
> That one character may seem mostly superfluous, but it's worth it. I forget sometimes myself, but it's still good practice. Please continue to use 0.9f rather than 0.9 whenever possible.
>
> Thanks,
> ~Matt
>
>
> On Feb 21, 2010, at 11:40 PM, Chris Walton wrote:
>
>> MSVC will warn about it (it expects 0.9 for double and 0.9f for float).
>>
>> On Mon, Feb 22, 2010 at 6:42 AM, Christopher Thielen <chris at epiar.net> wrote:
>>> Hey maoserr,
>>> Is the f needed on 0.9f to stop compiler warnings, e.g. see: http://github.com/maoserr/Epiar/commit/cb65058a2c8b444daacd7a6c6a90b45581828867 . In general I don't like that syntax but if it's needed to stop a compiler warning, then that's alright.
>>> Let us know,
>>>
>>> - Chris
>>> _______________________________________________
>>> epiar-devel mailing list
>>> epiar-devel at epiar.net
>>> http://epiar.net/mailman/listinfo/epiar-devel
>>>
>>
>> _______________________________________________
>> epiar-devel mailing list
>> epiar-devel at epiar.net
>> http://epiar.net/mailman/listinfo/epiar-devel
>
>
> _______________________________________________
> epiar-devel mailing list
> epiar-devel at epiar.net
> http://epiar.net/mailman/listinfo/epiar-devel
>
More information about the epiar-devel
mailing list