1. Check out our app, Forums for Android! Download and leave feedback here!

N00b Java question...

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

  1. MattThing

    MattThing Active Member
    Thread Starter
    36

    Oct 20, 2010
    39
    1
    36
    UK
    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.
     

    Advertisement

  2. itwt

    itwt New Member
    6

    Oct 20, 2010
    3
    1
    6
    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 Active Member
    Thread Starter
    36

    Oct 20, 2010
    39
    1
    36
    UK
    Interesting, thank you!
     

Share This Page

Loading...