Storm 1.10.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
math.h
Go to the documentation of this file.
1#ifndef STORM_UTILITY_MATH_H_
2#define STORM_UTILITY_MATH_H_
3
4#include <cmath>
6
7namespace storm {
8namespace utility {
9namespace math {
10
11inline uint64_t uint64_log2(uint64_t n) {
12 STORM_LOG_ASSERT(n != 0, "N is 0.");
13#define S(k) \
14 if (n >= (UINT64_C(1) << k)) { \
15 i += k; \
16 n >>= k; \
17 }
18 uint64_t i = 0;
19 S(32);
20 S(16);
21 S(8);
22 S(4);
23 S(2);
24 S(1);
25 return i;
26#undef S
27}
28} // namespace math
29} // namespace utility
30} // namespace storm
31
32#endif /* STORM_UTILITY_MATH_H_ */
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define S(k)
uint64_t uint64_log2(uint64_t n)
Definition math.h:11
LabParser.cpp.