◆ log10()

IEEEValue boost::simd::log10 ( IEEEValue const &  x)

This function object returns the base ten logarithm of its argument.

For integer input types log10 return the truncation of the real result.

Header <boost/simd/function/log10.hpp>
Decorators
  • std_ for floating entries calls std::log10
See also
log, log2, log1p
Example:
#include <boost/simd/exponential.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack<float, 4>;
int main() {
pack_ft pf = {1.0f, 2.0f, 1000.0f, 0.5f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::log10(pf) = " << bs::log10(pf) << '\n';
float xf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::log10(xf) = " << bs::log10(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, 1000, 0.5)
-> bs::log10(pf) = (0, 0.30103, 3, -0.30103)
---- scalar
<- xf = 2
-> bs::log10(xf) = 0.30103