• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps N00b Java question...

MattThing

Newbie
Hi all,

I'm very new to Java and currently working through a very good book but have a question. Currently working with numeric data types, specifically double and float.

It's said in the book that most of the time double should be used as it's more accurate, which is fair enough but I'm curious, under what circumstances would you use float over double, if any?

Thanks.
 
It all depends on what kind of range you're talking about, and how accurate you need it. For optimising code, float is faster to calculate.
 
Back
Top Bottom