Mail Archives: djgpp/1997/01/25/22:49:27
On 25 Jan 1997 20:51:52 GMT, jz AT bcsupernet DOT com wrote:
>Can anyone tell me why my printf("%.6f") is running so incredibly slowly?
>I'm running gcc on a 386 with no copro if that's a clue. The same line
>compiled under Borland C is MUCH faster. this is more than a pmode problem I
>am sure. Help. Thanks.
Is this the only line in your program? If so, then the program compiled under
DJGPP will always run slower. This is because DJGPP spends a lot of time in
startup code compared to a single library function like printf().
Also, the line you provided is incomplete. printf("%.6f") is a meaningless
call. You will need to post the code that is giving you problems.
>Does anyone have/know of a library or routine to convert from float to a
>string which is quick?
Look at sprintf(). It does everything printf() does, except the output is sent
to a character array (string) which is automatically null-terminated.
- Raw text -