_strtold() & atof() PLEASE HELP , C++ beginer.

Thanks Blitz for replying, but I had found that web site already. The function is that web ste is strtod() "string to double", however i need _strtold() "string to long double", I ha tried to modify the strtod() code but I am losing percision. I am obviously doing something wrong. Can anyone tell me how to modify the code for long double? the code can be found at

http://tcl.apache.org/sources/tcl/compat/strtod.c.html

thanking you in advance, Cremin.

Comments

  • : Thanks Blitz for replying, but I had found that web site already. The function is that web ste is strtod() "string to double", however i need _strtold() "string to long double", I ha tried to modify the strtod() code but I am losing percision. I am obviously doing something wrong. Can anyone tell me how to modify the code for long double? the code can be found at
    :
    : http://tcl.apache.org/sources/tcl/compat/strtod.c.html
    :
    : thanking you in advance, Cremin.
    :

    Are you using VC++ to compile the code ?

    If the output of the following line:
    [code]
    printf("%d", sizeof(long double));
    [/code]
    is 8, then you're using the same nasty compiler as I am ...

    Try compiling the code with a compiler that supports the 80-bit "long double" type ... for example, [b]gcc[/b] >:)

    Cheers,
    Blitz.
  • : Thanks Blitz for replying, but I had found that web site already. The function is that web ste is strtod() "string to double", however i need _strtold() "string to long double", I ha tried to modify the strtod() code but I am losing percision. I am obviously doing something wrong. Can anyone tell me how to modify the code for long double? the code can be found at
    :
    : http://tcl.apache.org/sources/tcl/compat/strtod.c.html
    :
    : thanking you in advance, Cremin.
    :


    Hey Blitz,

    The thing is, I am building an application for WinCE and I am using the embedded VC++ compiler which also only has a 8 bit representation for long double instead of the 10 bit rep I need. Is there no possible way to solve this problem due to the environement? Will I have to accept that I will only have percision up to 1.0e256?
    This probabaly sounds like a stupid question to you, please bare with me I am on work experience for college?

    Thanking you Kieran Cremin.

  • : : Thanks Blitz for replying, but I had found that web site already. The function is that web ste is strtod() "string to double", however i need _strtold() "string to long double", I ha tried to modify the strtod() code but I am losing percision. I am obviously doing something wrong. Can anyone tell me how to modify the code for long double? the code can be found at
    : :
    : : http://tcl.apache.org/sources/tcl/compat/strtod.c.html
    : :
    : : thanking you in advance, Cremin.
    : :
    :
    :
    : Hey Blitz,
    :
    : The thing is, I am building an application for WinCE and I am using the embedded VC++ compiler which also only has a 8 byte representation for long double instead of the 10 byte rep I need. Is there no possible way to solve this problem due to the environement? Will I have to accept that I will only have percision up to 1.0e256?
    : This probabaly sounds like a stupid question to you, please bare with me I am on work experience for college?
    :
    : Thanking you Kieran Cremin.
    :
    :

  • : : Thanks Blitz for replying, but I had found that web site already. The function is that web ste is strtod() "string to double", however i need _strtold() "string to long double", I ha tried to modify the strtod() code but I am losing percision. I am obviously doing something wrong. Can anyone tell me how to modify the code for long double? the code can be found at
    : :
    : : http://tcl.apache.org/sources/tcl/compat/strtod.c.html
    : :
    : : thanking you in advance, Cremin.
    : :
    :
    :
    : Hey Blitz,
    :
    : The thing is, I am building an application for WinCE and I am using the embedded VC++ compiler which also only has a 8 bit representation for long double instead of the 10 bit rep I need. Is there no possible way to solve this problem due to the environement? Will I have to accept that I will only have percision up to 1.0e256?
    : This probabaly sounds like a stupid question to you, please bare with me I am on work experience for college?
    :
    : Thanking you Kieran Cremin.
    :
    :

    I already suggested that you should look for
    another C compiler ...

    However, there's also the variant to emulate the
    80-bit floating-point values through C or assembler
    code (if you're designing the application for a specific platform, of course) but you wouldn't be able
    to propagate the results if the compiler doesn't
    support intrinsic 80-bit long doubles :((

    And that concludes you either try a new compiler, either provide custom routines for ALL computations
    involving those long doubles ...

    Cheers,
    Blitz

    PS: why do you need that precison, anyway ?

Sign In or Register to comment.

Howdy, Stranger!

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

Categories