M
Malcolm
/*
converts a double to decimal with no loss of accuracy.
*/
void accurate(char *out, double x)
{
char fmt[32];
sprintf(fmt, "%%.%dg", DBL_DIG);
sprintf(out, fmt, x);
}
Any way of getting rid of the first call to sprintf() ?
converts a double to decimal with no loss of accuracy.
*/
void accurate(char *out, double x)
{
char fmt[32];
sprintf(fmt, "%%.%dg", DBL_DIG);
sprintf(out, fmt, x);
}
Any way of getting rid of the first call to sprintf() ?