Help - Method for converting float to double

Discussion in 'The Lounge' started by mcvishnuprasad, Jan 3, 2008.

  1. mcvishnuprasad

    mcvishnuprasad

    Joined:
    Jan 3, 2008
    Messages:
    1
    Could anybody suggest an efficient method for converting float to double?

    Thanks in advance...
     
    mcvishnuprasad, Jan 3, 2008
    #1
    1. Advertising

  2. mcvishnuprasad

    Andre khoury

    Joined:
    Mar 9, 2008
    Messages:
    1
    Location:
    i live in lebanon beirut
    first of al u want to know in java langauge or c++
    anyway in java u have to convert float to String then String to double i will show u how :
    float a=123.3333f;
    System.out.println(a);
    String b=String.valueOf(a);
    double c=Double.valueOf(b);
    doube test=c;//just tomakesure that it will work and it does:)
    System.out.println(test);//output double value
    Ejoy;
    Sincerly Andre
     
    Andre khoury, Mar 9, 2008
    #2
    1. Advertising

  3. mcvishnuprasad

    d_wzrdv_z

    Joined:
    Jul 24, 2008
    Messages:
    3
    Location:
    Melbourne
    yeah - js and vb are a pain, but c, c++, c# and java should be able to cast it quite similarly. just remember to make sure that the precision is correct if its a spaceman or geneticists double!

    dwiz
     
    d_wzrdv_z, Jul 24, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Accuosti
    Replies:
    3
    Views:
    549
    Travis Evans
    Sep 27, 2004
  2. ass_rasta@hotmail.com

    Re: Pizza Roma to have float in Xmas parade

    ass_rasta@hotmail.com, Nov 29, 2003, in forum: Digital Photography
    Replies:
    2
    Views:
    527
    Russell B Waters
    Dec 4, 2003
  3. The Man With No Name
    Replies:
    3
    Views:
    882
  4. kishore.kommula

    HOW TO REPLACE float.

    kishore.kommula, Aug 22, 2007, in forum: Software
    Replies:
    0
    Views:
    828
    kishore.kommula
    Aug 22, 2007
  5. Giuen
    Replies:
    0
    Views:
    1,459
    Giuen
    Sep 12, 2008
Loading...

Share This Page