Mercurial > hg > octave-nkf
diff liboctave/dMatrix.cc @ 7124:d07cb867891b
[project @ 2007-11-08 01:09:44 by jwe]
author | jwe |
---|---|
date | Thu, 08 Nov 2007 01:09:44 +0000 |
parents | 6d3e53a2f963 |
children | 7da4a5262e2e |
line wrap: on
line diff
--- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -2108,10 +2108,12 @@ // We compute the size of iwork because DGELSD in older versions // of LAPACK does not return it on a query call. + double dminmn = static_cast<double> (minmn); + double dsmlsizp1 = static_cast<double> (smlsiz+1); #if defined (HAVE_LOG2) - double tmp = log2 (minmn) / static_cast<double> (smlsiz+1) + 1; + double tmp = log2 (dminmn) / dsmlsizp1 + 1; #else - double tmp = log (minmn) / static_cast<double> (smlsiz+1) / log (2) + 1; + double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1; #endif octave_idx_type nlvl = static_cast<int> (tmp); if (nlvl < 0) @@ -2271,10 +2273,12 @@ // We compute the size of iwork because DGELSD in older versions // of LAPACK does not return it on a query call. + double dminmn = static_cast<double> (minmn); + double dsmlsizp1 = static_cast<double> (smlsiz+1); #if defined (HAVE_LOG2) - double tmp = log2 (minmn) / static_cast<double> (smlsiz+1) + 1; + double tmp = log2 (dminmn) / dsmlsizp1 + 1; #else - double tmp = log (minmn) / static_cast<double> (smlsiz+1) / log (2) + 1; + double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1; #endif octave_idx_type nlvl = static_cast<int> (tmp); if (nlvl < 0)