Mercurial > hg > octave-nkf
diff liboctave/array/CMatrix.cc @ 19037:ff4da3c8ed16 stable
use gnulib log2 modules (bug #42583)
* bootstrap.conf (gnulib_modules): Include log2, log2f, log2-ieee, and
log2f-ieee, in the list.
* lo-mappers.cc (xlog2): Use gnulib:: versions of log2 and log2f.
* CMatrix.cc, dMatrix.cc, fCMatrix.cc, fMatrix.cc: Use xlog2.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 19 Jun 2014 15:49:14 -0400 |
parents | 49a5a4be04a1 |
children | b314efd58072 |
line wrap: on
line diff
--- a/liboctave/array/CMatrix.cc +++ b/liboctave/array/CMatrix.cc @@ -2683,11 +2683,8 @@ // call. double dminmn = static_cast<double> (minmn); double dsmlsizp1 = static_cast<double> (smlsiz+1); -#if defined (HAVE_LOG2) - double tmp = log2 (dminmn / dsmlsizp1); -#else - double tmp = log (dminmn / dsmlsizp1) / log (2.0); -#endif + double tmp = xlog2 (dminmn / dsmlsizp1); + octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1; if (nlvl < 0) nlvl = 0; @@ -2875,11 +2872,8 @@ // call. double dminmn = static_cast<double> (minmn); double dsmlsizp1 = static_cast<double> (smlsiz+1); -#if defined (HAVE_LOG2) - double tmp = log2 (dminmn / dsmlsizp1); -#else - double tmp = log (dminmn / dsmlsizp1) / log (2.0); -#endif + double tmp = xlog2 (dminmn / dsmlsizp1); + octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1; if (nlvl < 0) nlvl = 0;