N00b Java question...


Last Updated:

  1. MattThing

    MattThing Active Member This Topic's Starter

    Joined:
    Oct 20, 2010
    Messages:
    39
    Likes Received:
    1
    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

    Joined:
    Oct 20, 2010
    Messages:
    3
    Likes Received:
    1
    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 This Topic's Starter

    Joined:
    Oct 20, 2010
    Messages:
    39
    Likes Received:
    1
    Interesting, thank you!
     

Share This Page

Loading...