Tempo ramps - fix crazy compilable namespace thinko
[ardour.git] / libs / pbd / msvc / msvc_pbd.cc
index ddef9685699d3c4807e5d1697c34bad9f9c1c860..ab79d8f45de8950213ef467112d5e8879c34a600 100644 (file)
@@ -262,6 +262,25 @@ trunc(double x)
        return (floor(x));
 }
 
+//***************************************************************
+//
+//     log2()
+//
+// Emulates C99 log2() using log().
+//
+//     Returns:
+//
+//    On Success: The binary (base-2) logarithm of 'x'
+//                (e.g. log2(1024) == 10).
+//    On Failure: None, except that calling log(x) should generate
+//                an appropriate error for us (such as ERANGE etc).
+//
+LIBPBD_API double PBD_APICALLTYPE
+log2(double x)
+{
+       return (log(x) / log((double)2.0));
+}
+
 namespace PBD {
 
 //***************************************************************