+++ /dev/null
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>nbdkit is_power_of_2</h1>
-
-<pre class="code">
- /* Returns true if v is a power of 2.
- *
- * Uses the algorithm described at
- * http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
- */
- static inline bool
- is_power_of_2 (unsigned long v)
- {
- return v && ((v & (v - 1)) == 0);
- }
-</pre>
+++ /dev/null
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>nbdkit is_power_of_2</h1>
-
-<pre class="code">
- /*@
- predicate positive_power_of_2 (integer i) =
- i > 0 &&
- (i == 1 || ((i & 1) == 0 && positive_power_of_2 (i >> 1)));
-
- lemma positive_power_of_2 (1);
- lemma positive_power_of_2 (2);
- lemma positive_power_of_2 (4);
- lemma !positive_power_of_2 (7);
- */
-</pre>
-
-<a href="https://stackoverflow.com/questions/64268418/how-do-i-write-an-is-power-of-2-predicate-in-acsl">https://stackoverflow.com/questions/64268418/how-do-i-write-an-is-power-of-2-predicate-in-acsl</a>