## ◆ ceil()

 Value boost::simd::ceil ( Value const & x )

This function object computes the smallest integral representable value of its parameter type which is greater or equal to it.

Notes
• ceil is also used as parameter to pass to div or rem
Decorators
• std_ for floating entries call std::ceil
floor, round, nearbyint, trunc, iceil
Example:
#include <boost/simd/arithmetic.hpp>
#include <boost/simd/pack.hpp>
#include <boost/simd/function/enumerate.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 8>;
int main()
{
pack_ft pf = bs::enumerate<pack_ft>(-2.56, 0.51);
std::cout
<< "---- simd" << '\n'
<< " <- pf = " << pf << '\n'
<< " -> bs::ceil(pf) = " << bs::ceil(pf) << '\n';
float xf = 3.2f, yf = -3.2f;
std::cout
<< "---- scalar" << '\n'
<< " <- xf = " << xf<< '\n'
<< " -> bs::ceil(xf) = " << bs::ceil(xf) << '\n'
<< " <- yf = " << yf << '\n'
<< " -> bs::ceil(yf) = " << bs::ceil(yf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (-2.56, -2.05, -1.54, -1.03, -0.52, -0.00999999, 0.5, 1.01)
-> bs::ceil(pf) = (-2, -2, -1, -1, -0, -0, 1, 2)
---- scalar
<- xf = 3.2
-> bs::ceil(xf) = 4
<- yf = -3.2
-> bs::ceil(yf) = -3