## ◆ minnum()

 Value boost::simd::minnum ( Value const & x, Value const & y )

This function object returns the smaller of two floating point arguments, treating NaNs as missing data (between a NaN and a numeric value, the numeric value is chosen).

Decorators
• std_ for floating entries calls the stdlibc++ function std::fmin.
min, minmag, minnummag
Example:
#include <boost/simd/ieee.hpp>
#include <boost/simd/pack.hpp>
#include <boost/simd/constant/nan.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 4>;
int main()
{
pack_ft pf = { 3.0f, -2.0f, -0.0f, 0.0f };
pack_ft qf = { 4.0f, -1.0f, 0.0f, bs::Nan<float>() };
std::cout
<< "---- simd" << '\n'
<< " <- pf = " << pf << '\n'
<< " <- qf = " << qf << '\n'
<< " -> bs::minnum(pf, qf) = " << bs::minnum(pf, qf) << '\n'
<< " -> bs::std_(bs::minnum)(pf, qf) = " << bs::std_(bs::minnum)(pf, qf) << '\n';
float xf = 3.0f, yf = 4.0f;
std::cout
<< "---- scalar" << '\n'
<< " xf = " << xf << '\n'
<< " yf = " << yf << '\n'
<< " -> bs::minnum(xf, yf) = " << bs::minnum(xf, yf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (3, -2, -0, 0)
<- qf = (4, -1, 0, -nan)
-> bs::minnum(pf, qf) = (3, -2, -0, 0)
-> bs::std_(bs::minnum)(pf, qf) = (3, -2, -0, 0)
---- scalar
xf = 3
yf = 4
-> bs::minnum(xf, yf) = 3