bit_floor

bit_floor#

stdgpu: stdgpu::bit_floor
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ bit_floor()

template<typename T , STDGPU_DETAIL_OVERLOAD_IF(std::is_unsigned_v< T >) >
STDGPU_HOST_DEVICE T stdgpu::bit_floor ( const T  number)
noexcept

Computes the largest power of two which is smaller or equal than the given number.

Parameters
[in]numberA number
Returns
The largest power of two which is smaller than the given number