Improved the test for the pow-of-2 constraint from Mark's recommendation.

This commit is contained in:
henry 2009-01-30 15:02:00 +00:00
parent f0f677e3d6
commit 60dba3fba4

View File

@ -48,8 +48,9 @@ void fft::transform
{
forAll(nn, idim)
{
scalar pow2 = log(scalar(nn[idim]))/log(scalar(2));
if ((pow2 - int(pow2 + 0.5)) > SMALL)
// Check for power of two
unsigned int dimCount = nn[idim];
if (!dimCount || (dimCount & (dimCount - 1)))
{
FatalErrorIn
(