** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezsupport.cpp,v 1.2 2000/06/19 19:04:05 kevin Exp $
+** $Id: ezsupport.cpp,v 1.4 2000/07/13 07:03:21 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
{
double integer;
- double frac = modf (x, &integer);
+ modf (x, &integer);
return (integer);
}
wid = 2 + frac + expon;
if (minval < 0. || maxval < 0.)
++wid;
- snprintf (fmtstr, sizeof(fmtstr), "%%%d.%dle", wid, frac);
+ sprintf (fmtstr, "%s%d%s%d%s", "%", wid, ".", frac, "g");
} else { /* use fixed format */
wid = static_cast<int>(trunc(logt)) + 1;
if (wid < 1)
frac = *nfrac;
wid += 1 + frac;
- snprintf (fmtstr, sizeof(fmtstr), "%%%d.%dlf", wid, frac);
+ sprintf (fmtstr, "%s%d%s%d%s", "%", wid, ".", frac, "f");
}
-
+
*fldwid = wid;
*nfrac = frac;
}