commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8225 - gnuradio/branches/developers/eb/gcell/gnuradio


From: eb
Subject: [Commit-gnuradio] r8225 - gnuradio/branches/developers/eb/gcell/gnuradio-core/src/lib/general
Date: Sat, 19 Apr 2008 19:36:25 -0600 (MDT)

Author: eb
Date: 2008-04-19 19:36:25 -0600 (Sat, 19 Apr 2008)
New Revision: 8225

Modified:
   gnuradio/branches/developers/eb/gcell/gnuradio-core/src/lib/general/gr_math.h
Log:
added gr_is_power_of_2 predicate

Modified: 
gnuradio/branches/developers/eb/gcell/gnuradio-core/src/lib/general/gr_math.h
===================================================================
--- 
gnuradio/branches/developers/eb/gcell/gnuradio-core/src/lib/general/gr_math.h   
    2008-04-20 01:34:52 UTC (rev 8224)
+++ 
gnuradio/branches/developers/eb/gcell/gnuradio-core/src/lib/general/gr_math.h   
    2008-04-20 01:36:25 UTC (rev 8225)
@@ -29,6 +29,12 @@
 
 #include <gr_complex.h>
 
+static inline bool
+gr_is_power_of_2(long x)
+{
+  return x != 0 && (x & (x-1)) == 0;
+}
+
 long gr_gcd (long m, long n);
 
 // returns a non-zero value if value is "not-a-number" (NaN), and 0 otherwise





reply via email to

[Prev in Thread] Current Thread [Next in Thread]