Skip to content

Commit

Permalink
fix @axman6's dodgy code
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcdonell committed Aug 21, 2017
1 parent 9c2ecad commit 657adbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion repa-algorithms/Data/Array/Repa/Algorithms/FFT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ module Data.Array.Repa.Algorithms.FFT
, fft2dP
, fft1dP)
where

import Data.Array.Repa.Algorithms.Complex
import Data.Array.Repa as R
import Data.Array.Repa.Eval as R
import Data.Array.Repa.Unsafe as R
import Prelude as P

import Data.Bits ((.&.))
import Prelude as P


data Mode
Expand All @@ -43,6 +45,8 @@ signOfMode mode
-- The implementation can be found in Henry S. Warren, Jr.'s book
-- Hacker's delight, Chapter 2.
isPowerOfTwo :: Int -> Bool
isPowerOfTwo 0 = True
isPowerOfTwo 1 = False
isPowerOfTwo n = (n .&. (n-1)) == 0
{-# INLINE isPowerOfTwo #-}

Expand Down

0 comments on commit 657adbf

Please sign in to comment.