Results 1 to 3 of 3
  1. #1
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default double or float for importing data?

    I am designing Java programs for data mining/machine learning applications. Can anyone tell me should I use double or float for importing the data?

    What is the convention?

    Thanks a lot!;)

  2. #2
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Hey, I dont think there is any convention. You should just look of how much precision you need the system to have. Double would give you the largest precision.(Largest amount of numbers)
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  3. #3
    thomasdevos's Avatar
    thomasdevos is offline Member
    Join Date
    Feb 2010
    Posts
    19
    Rep Power
    0

    Default

    hi tyang
    float or double got different precision,one is smaller another one is bigger.
    you can take this code to see exactly how it is working there:
    Java Code:
    public class DoubleAndFloat {
    	public static void main(String[] args) {
    		System.out.println( Double.MAX_VALUE);
    		System.out.println( Float.MAX_VALUE);
    	}
    }
    the result is :
    Java Code:
    1.7976931348623157E308
    3.4028235E38
    so, to choose double or float is depending on the bussiness which you are mining on.
    actually float is big enough in most of the time, i personal feel.
    good luck
    i hold 7 years develop exp. now i start a thread to share my knowlege about a j2ee project. welcome to participate.Study Java Through Real Java Project

Similar Threads

  1. double and float value in java
    By arvindmer in forum New To Java
    Replies: 6
    Last Post: 05-28-2009, 04:51 PM
  2. Float vs. Double
    By javanub in forum New To Java
    Replies: 1
    Last Post: 11-23-2008, 12:11 PM
  3. Float and double to binary
    By rosh72851 in forum Advanced Java
    Replies: 3
    Last Post: 09-24-2008, 06:29 AM
  4. Put float value to double
    By chamalsl in forum New To Java
    Replies: 3
    Last Post: 09-20-2008, 04:52 AM
  5. Replies: 2
    Last Post: 11-16-2007, 01:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •