diff options
author | Pascal Junck <pjunck@openoffice.org> | 2004-11-02 09:30:06 +0000 |
---|---|---|
committer | Pascal Junck <pjunck@openoffice.org> | 2004-11-02 09:30:06 +0000 |
commit | 6513bd3a208730031fcbcee96672c37d247f76b2 (patch) | |
tree | 9076581c05825ae4cc2b07dccecc79594ac9d228 /sal/qa | |
parent | 0a3d968930a1704f38cea0f20a412e73743404a9 (diff) |
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
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/inc/valueequal.hxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sal/qa/inc/valueequal.hxx b/sal/qa/inc/valueequal.hxx index 6556f16b8cd4..df989c1e90a8 100644 --- a/sal/qa/inc/valueequal.hxx +++ b/sal/qa/inc/valueequal.hxx @@ -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"); } |