Mercurial > octave-nkf
diff liboctave/array/fMatrix.cc @ 18881: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/fMatrix.cc Thu Jun 19 09:41:12 2014 -0700 +++ b/liboctave/array/fMatrix.cc Thu Jun 19 15:49:14 2014 -0400 @@ -2340,11 +2340,8 @@ // of LAPACK does not return it on a query call. float dminmn = static_cast<float> (minmn); float dsmlsizp1 = static_cast<float> (smlsiz+1); -#if defined (HAVE_LOG2) - float tmp = log2 (dminmn / dsmlsizp1); -#else - float tmp = log (dminmn / dsmlsizp1) / log (2.0); -#endif + float tmp = xlog2 (dminmn / dsmlsizp1); + octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1; if (nlvl < 0) nlvl = 0; @@ -2531,11 +2528,8 @@ // of LAPACK does not return it on a query call. float dminmn = static_cast<float> (minmn); float dsmlsizp1 = static_cast<float> (smlsiz+1); -#if defined (HAVE_LOG2) - float tmp = log2 (dminmn / dsmlsizp1); -#else - float tmp = log (dminmn / dsmlsizp1) / log (2.0); -#endif + float tmp = xlog2 (dminmn / dsmlsizp1); + octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1; if (nlvl < 0) nlvl = 0;