diff options
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/H5private.h b/src/H5private.h index 531b3dd..5d1494f 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -326,7 +326,8 @@ #endif /* test for number that is a power of 2 */ -# define POWER_OF_TWO(n) ((((n) - 1) & (n)) == 0 && (n) > 0) +/* (from: http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2) */ +# define POWER_OF_TWO(n) (!(n & (n - 1)) && n) /* * HDF Boolean type. |