1. Are you ready for the Galaxy S20? Here is everything we know so far!

N00b Java question...

Discussion in 'Android Development' started by MattThing, Oct 21, 2010.

  1. MattThing

    MattThing Newbie
    Thread Starter

    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?


    1. Download the Forums for Android™ app!


  2. itwt

    itwt Lurker

    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.
    MattThing likes this.
  3. MattThing

    MattThing Newbie
    Thread Starter

    Interesting, thank you!

Share This Page