double conversion ! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

double conversion !

da_comp_guyda_comp_guy Posts: 37Member
I kinda need some answers for dis very badly...how do i remove the (e) notation ..in the "double" data type. what i basically want to say is...i need to convert a huge number say around 10 digits, which "int" can't handle, but"double" can.At the same time i don't want the approximation to b done (2.34656e+10). I need to handle really large numbers...which shud b very precise(shud give the exact answer). i was jus wonderning..can i create my own data type?( not structures,classes and stuff...!).
plz help..thanx !
"[b]The[blue] GEEK[/blue] Shall Inherit The Earth" ;-) [/b]

Comments

  • DonotaloDonotalo Posts: 715Member
    : I kinda need some answers for dis very badly...how do i remove the (e) notation ..in the "double" data type. what i basically want to say is...i need to convert a huge number say around 10 digits, which "int" can't handle, but"double" can.At the same time i don't want the approximation to b done (2.34656e+10). I need to handle really large numbers...which shud b very precise(shud give the exact answer). i was jus wonderning..can i create my own data type?( not structures,classes and stuff...!).
    : plz help..thanx !
    : "[b]The[blue] GEEK[/blue] Shall Inherit The Earth" ;-) [/b]
    :
    [purple]of course u can. just need proper format:
    [code]
    double a = 999.12345678901234;

    /* C style, output: 999.12345678901238 */
    printf("%.14f
    ", a);

    // C++ style, output: 999.12345678901
    cout.precision(14);
    cout << a << endl;
    [/code]
    take a glance at the outputs.
    [/purple]
    [hr][purple]~Donotalo()[/purple]

  • da_comp_guyda_comp_guy Posts: 37Member
    THANX A LOT..BUT IT SEEMS DAT THE PRECISION IS FOR ONLY 20 DIGITS MAX ! AFTER DAT..THE (e) NOTATION AGAIN COMES UP.
    BUT THANX A LOT ANYWAYS !

    "[b]The[blue] GEEK[/blue] Shall Inherit The Earth" ;-) [/b]

Sign In or Register to comment.