Double or Float?

1 view
Skip to first unread message

Hicks, Matt

unread,
Jul 17, 2010, 2:42:46 PM7/17/10
to sgin...@googlegroups.com
Hey guys, we finally merged in simplex3d branch to default and immediately afterward I converted from Double to Float for the engine in order to better support mobile devices.  However, based on this article Lex sent me:

http://developer.android.com/guide/practices/design/performance.html#avoidfloat

It would appear in more recent hardware there's no performance difference between Double and Float.  So, I'd like to ask for some feedback on whether we should be using Double or Float for all our math?  At this point switching back to Double is a matter of going back a couple revisions so we need to make this decision once and for all.  Can anyone elaborate on additional reasons to use one over another?

Thanks,

Matt

philip

unread,
Jul 19, 2010, 4:00:12 AM7/19/10
to sgine-dev
As a C/C++ programmer, I always used double and long. never int or
float as int and float width could vary depending on the machine which
prevented portability.

On Jul 18, 2:42 am, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> Hey guys, we finally merged in simplex3d branch to default and immediately
> afterward I converted from Double to Float for the engine in order to better
> support mobile devices.  However, based on this article Lex sent me:
>
> http://developer.android.com/guide/practices/design/performance.html#...

Hicks, Matt

unread,
Sep 24, 2010, 6:48:32 PM9/24/10
to sgin...@googlegroups.com
Well, you'll be happy to know that we're sticking with Double. ;)

On Fri, Sep 24, 2010 at 5:36 PM, Jacob Biggs <biggs...@gmail.com> wrote:
I would personally always choose Double over Float, since the
performance is negligible and the extra precision is never
detrimental! Especially when precision really matters.

On Jul 17, 12:42 pm, "Hicks, Matt" <mhi...@captiveimagination.com>

wrote:
> Hey guys, we finally merged in simplex3d branch to default and immediately
> afterward I converted from Double to Float for the engine in order to better
> support mobile devices.  However, based on this article Lex sent me:
>

Jacob Biggs

unread,
Sep 24, 2010, 7:34:35 PM9/24/10
to sgin...@googlegroups.com
Awesome :P  I've had so many problems in programming class with inaccuracies caused by Floats! 
Reply all
Reply to author
Forward
0 new messages