| 1 | /* pow2, Copyright (c) 2016 Dave Odell <dmo2118@gmail.com> |
| 2 | * |
| 3 | * Permission to use, copy, modify, distribute, and sell this software and its |
| 4 | * documentation for any purpose is hereby granted without fee, provided that |
| 5 | * the above copyright notice appear in all copies and that both that |
| 6 | * copyright notice and this permission notice appear in supporting |
| 7 | * documentation. No representations are made about the suitability of this |
| 8 | * software for any purpose. It is provided "as is" without express or |
| 9 | * implied warranty. |
| 10 | */ |
| 11 | |
| 12 | #ifndef POW2_H |
| 13 | #define POW2_H |
| 14 | |
| 15 | #include <stdlib.h> |
| 16 | |
| 17 | extern int i_log2(size_t x); |
| 18 | extern size_t to_pow2 (size_t x); /* return the next larger power of 2. */ |
| 19 | |
| 20 | #endif /* POW2_H */ |