Browse Source

Fixed issue in Sylvan where large numbers were not recognized as powers of 2.

__builtin_popcount only takes unsigned int as input, but not larger numbers (e.g. 2^33).
We use bit operations instead now.
tempestpy_adaptions
Matthias Volk 5 years ago
parent
commit
3fa0b5aabb
  1. 2
      resources/3rdparty/sylvan/src/sylvan_common.c

2
resources/3rdparty/sylvan/src/sylvan_common.c

@ -276,7 +276,7 @@ static size_t table_min = 0, table_max = 0, cache_min = 0, cache_max = 0;
static int static int
is_power_of_two(size_t size) is_power_of_two(size_t size)
{ {
return __builtin_popcount(size) == 1 ? 1 : 0;
return (size != 0) && ((size & (size-1)) == 0);
} }
void void

Loading…
Cancel
Save