Page MenuHomePhorge

math.hpp
No OneTemporary

Size
666 B
Referenced Files
None
Subscribers
None

math.hpp

/***************************************************************************//**
*
* \file rosa/support/math.hpp
*
* \author David Juhasz (david.juhasz@tuwien.ac.at)
*
* \date 2017
*
* \brief Math helpers.
*
******************************************************************************/
#ifndef ROSA_SUPPORT_MATH_HPP
#define ROSA_SUPPORT_MATH_HPP
#include <cstdlib>
namespace rosa {
/// Computes log base 2 of a number.
///
/// \param N the number to compute log base 2 for
///
/// \return log base 2 of `N`
constexpr size_t log2(const size_t N) {
return ((N < 2) ? 1 : 1 + log2(N / 2));
}
} // End namespace rosa
#endif // ROSA_SUPPORT_MATH_HPP

File Metadata

Mime Type
text/x-c++
Expires
Sun, May 31, 5:16 PM (20 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
328285
Default Alt Text
math.hpp (666 B)

Event Timeline