function 'ldtoa' in math.h

function 'ldtoa' in math.h

Post by Eberhard F » Sat, 22 Nov 2003 19:45:40


Hello all,

Is this a bug or not:

#include <math.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
long double ld;
char szText[20];

ld = 2.88;
ldtoa(ld, szText);
printf("%s\n", szText);

return 0;
}

I get the compiler message: undefined referenze to 'ldtoa'.
But if I write my source code, at the time I write ldtoa a
quickinfo comes with the description of this funktion.
But I do not found this function in crtdll.dll.

Regards

Eberhard
 
 
 

function 'ldtoa' in math.h

Post by John » Sat, 22 Nov 2003 20:48:01


"Eberhard Funck" <NOSPAM:: XXXX@XXXXX.COM ::NOSPAM> wrote


It will not be in there because it is a C99 function which MS does not
support in crtdll.dll.


It does appear to be a bug as it should be part of a library supplied
with lcc-win32.

Try this for now.

sprintf(szText, "%Lf", ld);

John

 
 
 

function 'ldtoa' in math.h

Post by Eberhard F » Sat, 22 Nov 2003 21:14:01


Hello John,

thank you for your answer and help.

I have write my own function "ftoa"
in the same way you show me.

Regards

Eberhard
 
 
 

function 'ldtoa' in math.h

Post by CBFalcone » Sun, 23 Nov 2003 01:38:37


I see not ldtoa specified in N869, and there is no reason for
such, since your sprintf solution is perfectly general. C99 adds
the appropriate format specifiers.

--
Chuck F ( XXXX@XXXXX.COM ) ( XXXX@XXXXX.COM )
Available for consulting/temporary embedded and systems.
< http://www.yqcomputer.com/ > USE worldnet address!
 
 
 

function 'ldtoa' in math.h

Post by John » Sun, 23 Nov 2003 01:52:10


wrote

I don't know where ldtoa comes from but lcc-win32 has it in math.h

John
 
 
 

function 'ldtoa' in math.h

Post by John » Sun, 23 Nov 2003 01:53:34


wrote

I assumed it was C99 at first.

John