std::floor2
来自cppreference.com
定义于头文件 <bit>
|
||
template< class T > constexpr T floor2(T x) noexcept; |
(C++20 起) | |
若 x
非零,则计算不大于 x
的最大的二的整数次幂。若 x
为零,则返回零。
此重载仅若 T
为无符号整数类型(即 unsigned char 、 unsigned short 、 unsigned int 、 unsigned long 、 unsigned long long 或扩展无符号整数类型)才参与重载决议。
返回值
若 x
为零则为零;否则为不大于 x
的最大的二的整数次幂。
示例
本节未完成 原因:暂无示例 |