37 _maxexp(maxexponent) {
39 std::cout<<
"ErrMsg(fatal) "<<
"Can't pack exponents larger than 62" << endl;
42 static double invln2(1.0/log(2.0));
45 _mansft = _maxexp>0?(unsigned)(log(
double(_maxexp))*invln2+1.01):0;
46 _expmsk = (1<<_mansft)-1;
49 double invmaxman = 1.0/_maxman;
50 long long maxnorm = (
one<<(maxexponent+1))-1;
53 long long norm =
one<<maxexponent;
54 double alpha = 1.0/((double)maxnorm*_maxman*2.0 - (norm + 1.0));
63 double manoff = (0.5 * invmaxman+1.0) * invmaxnorm;
64 double valoff =
_minVal - invmaxnorm;
65 double manfac = invmaxnorm * invmaxman;
67 _expfac =
new double[_maxexp+1];
68 _expoff =
new double[_maxexp+1];
69 for(
unsigned iexp=0;iexp<=_maxexp;iexp++){
70 double expf = (
one<<iexp);
71 _expoff[iexp] = valoff + manoff*expf;
72 _expfac[iexp] = manfac*expf;