INTEGRATION: CWS qadev19 (1.3.62); FILE MERGED
2004/08/04 07:00:07 mindyliu 1.3.62.3: #117552# tiny changes 2004/08/04 06:48:32 mindyliu 1.3.62.2: #117552# tiny changes 2004/08/04 03:30:32 mindyliu 1.3.62.1: #117552# when log10(x) < 0, the number after dot should be 14
This commit is contained in:
parent
0a3d968930
commit
6513bd3a20
1 changed files with 12 additions and 5 deletions
|
@ -45,22 +45,29 @@ bool is_equal(T x, T y, sal_Int16 _nPrec)
|
|||
t_print(T_VERBOSE, "double equal: %.20f\n", x);
|
||||
t_print(T_VERBOSE, " %.20f\n", y);
|
||||
}
|
||||
|
||||
sal_Int32 nPrecOfN = -nPRECISION + sal_Int32( log10(x) );
|
||||
//here nPrecOfN is the number after dot
|
||||
sal_Int32 nBeforeDot = sal_Int32( log10(x) );
|
||||
if ( nBeforeDot < 0)
|
||||
{
|
||||
nBeforeDot = 0;
|
||||
}
|
||||
//t_print(T_VERBOSE, "nPRECISION is %d\n", nPRECISION);
|
||||
sal_Int32 nPrecOfN = -nPRECISION + nBeforeDot;
|
||||
|
||||
if (_nPrec != PREC_long_double)
|
||||
t_print(T_VERBOSE, "prec: %d\n", nPrecOfN);
|
||||
t_print(T_VERBOSE, "nPrecOfN is %d\n", nPrecOfN);
|
||||
|
||||
T nPrec = pow(10, nPrecOfN) * 1;
|
||||
long double nPrec = pow(0.1, -nPrecOfN);
|
||||
|
||||
if (_nPrec != PREC_long_double)
|
||||
t_print(T_VERBOSE, " prec: %.20f\n", nPrec);
|
||||
|
||||
T nDelta = fabs( x - y );
|
||||
long double nDelta = fabs( x - y ) ;
|
||||
|
||||
if (_nPrec != PREC_long_double)
|
||||
{
|
||||
t_print(T_VERBOSE, " delta: %.20f\n", nDelta);
|
||||
t_print(T_VERBOSE, " nPrec: %.20f\n", nPrec);
|
||||
t_print(T_VERBOSE, "delta must be less or equal to prec!\n\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue