Mercurial > octave
comparison liboctave/numeric/lo-mappers.cc @ 18928:161ebb78ac1b
use gnulib::log and gnulib::logf functions
* Faddeeva.cc, lo-mappers.cc, lo-specfun.cc: Use gnulib::log and
gnulib::logf instead of log and logf.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 16 Jul 2014 19:56:22 -0400 |
parents | ff4da3c8ed16 |
children | ba7e42dea4b2 |
comparison
equal
deleted
inserted
replaced
18927:09eb8a2ddb02 | 18928:161ebb78ac1b |
---|---|
99 xlog2 (const Complex& x) | 99 xlog2 (const Complex& x) |
100 { | 100 { |
101 #if defined (M_LN2) | 101 #if defined (M_LN2) |
102 static double ln2 = M_LN2; | 102 static double ln2 = M_LN2; |
103 #else | 103 #else |
104 static double ln2 = log (2); | 104 static double ln2 = gnulib::log (2); |
105 #endif | 105 #endif |
106 | 106 |
107 return std::log (x) / ln2; | 107 return std::log (x) / ln2; |
108 } | 108 } |
109 | 109 |
114 return exp2 (x); | 114 return exp2 (x); |
115 #else | 115 #else |
116 #if defined (M_LN2) | 116 #if defined (M_LN2) |
117 static double ln2 = M_LN2; | 117 static double ln2 = M_LN2; |
118 #else | 118 #else |
119 static double ln2 = log (2); | 119 static double ln2 = gnulib::log (2); |
120 #endif | 120 #endif |
121 | 121 |
122 return exp (x * ln2); | 122 return exp (x * ln2); |
123 #endif | 123 #endif |
124 } | 124 } |
520 | 520 |
521 Complex | 521 Complex |
522 rc_log (double x) | 522 rc_log (double x) |
523 { | 523 { |
524 const double pi = 3.14159265358979323846; | 524 const double pi = 3.14159265358979323846; |
525 return x < 0.0 ? Complex (log (-x), pi) : Complex (log (x)); | 525 return x < 0.0 ? Complex (gnulib::log (-x), pi) : Complex (gnulib::log (x)); |
526 } | 526 } |
527 | 527 |
528 FloatComplex | 528 FloatComplex |
529 rc_log (float x) | 529 rc_log (float x) |
530 { | 530 { |
531 const float pi = 3.14159265358979323846f; | 531 const float pi = 3.14159265358979323846f; |
532 return x < 0.0f ? FloatComplex (logf (-x), pi) : FloatComplex (logf (x)); | 532 return (x < 0.0f |
533 ? FloatComplex (gnulib::logf (-x), pi) | |
534 : FloatComplex (gnulib::logf (x))); | |
533 } | 535 } |
534 | 536 |
535 Complex | 537 Complex |
536 rc_log2 (double x) | 538 rc_log2 (double x) |
537 { | 539 { |