27 PrintCtrl::CROP_TYPE_GLOBAL PrintCtrl::GlobalCrop = GCT_NOPREF;
30 PrintCtrl::PrintCtrl(std::ostream& coutProxy,
int Ndec,
58 pr_de(d, p, wMin, wMax);
104 double dfabs = fabs(d);
107 int requestedLength = 6 + p;
111 if (dfabs < 9.9999999999E-99) {
114 if (dfabs > 9.9999999999E99) {
117 if (requestedLength > wMax) {
118 p -= (requestedLength - wMax);
125 m_cout.setf(ios_base::scientific | ios_base::uppercase);
126 int wold = (int)
m_cout.width(wMin);
127 int pold = (int)
m_cout.precision(p);
132 m_cout.unsetf(ios_base::scientific);
161 if (Ndec < -301 || Ndec > 301) {
164 double dfabs = fabs(d);
165 double pdec = pow(10.0, (
double) Ndec);
169 double dl10 = log10(dfabs);
170 int N10 = (int) dl10;
174 int nsig = N10 - Ndec;
205 double dfabs = fabs(d);
206 double dl10 = log10(dfabs);
207 int N10 = (int) dl10;
211 int E10 = -N10 + nSig ;
212 double pfabs = dfabs * pow(10.0, (
double) E10);
213 pfabs *= (1.0 + 1.0E-14);
214 long int nfabs = (
long int) pfabs;
215 double remainder = pfabs - nfabs;
216 if (remainder > 0.5) {
219 double paltabs = (double) nfabs;
220 double daltabs = paltabs * pow(10.0, (
double) -E10);
221 return (sgn * daltabs);