Merge "[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-437] Establishing communication betwee...
[o-du/l2.git] / src / cm / cm_math.c
index 5a2b8a9..4167831 100755 (executable)
 #include "ssi.h"                /* system services interface */
 
 #include "cm_math.h"
-#include "cm_math.x"
-
 #include <stdlib.h>
-
 #include <math.h>
 
-
 #ifdef SS_FLOAT
 /*
 *
 *       File:  cm_math.c
 *
 */
-#ifdef ANSI
-PUBLIC U32 cmAbs
-(
-F64          val
-)
-#else
-PUBLIC U32 cmAbs(val)
-F64          val;
-#endif
+uint32_t cmAbs(F64  val)
 {
 #if (defined(SUNOS)|| defined(WIN32)|| defined(WIN2K)|| defined (SS_LINUX))
-   return ((U32) abs((int) val));/* G++ */
+   return ((uint32_t) abs((int) val));/* G++ */
 #endif
 } /* end of cmAbs */
 #endif /* SS_FLOAT */
@@ -92,17 +80,7 @@ F64          val;
 *       File:  cm_math.c
 *
 */
-#ifdef ANSI
-PUBLIC F64 cmPow
-(
-F64          x,
-F64          y
-)
-#else
-PUBLIC F64 cmPow(x, y)
-F64           x;
-F64           y;
-#endif
+F64 cmPow(F64 x,F64 y)
 {
 #if (defined(SUNOS)|| defined(WIN32)|| defined(WIN2K)|| defined (SS_LINUX))
    return ((F64) pow((F64)x, (F64)y));
@@ -125,15 +103,7 @@ F64           y;
 *       File:  cm_math.c
 *
 */
-#ifdef ANSI
-PUBLIC F64 cmFloor
-(
-F64          x
-)
-#else
-PUBLIC F64 cmFloor(x)
-F64           x;
-#endif
+F64 cmFloor(F64  x)
 {
 #if (defined(SUNOS)|| defined(WIN32)|| defined(WIN2K)|| defined (SS_LINUX))
    return ((F64) floor((F64)x));
@@ -156,15 +126,7 @@ F64           x;
 *       File:  cm_math.c
 *
 */
-#ifdef ANSI
-PUBLIC F64 cmLog
-(
-F64          x
-)
-#else
-PUBLIC F64 cmLog(x)
-F64           x;
-#endif
+F64 cmLog(F64 x)
 {
 #if (defined(SUNOS)|| defined(WIN32)|| defined(WIN2K)|| defined (SS_LINUX))
    return ((F64) log((F64)x));
@@ -187,15 +149,7 @@ F64           x;
 *       File:  cm_math.c
 *
 */
-#ifdef ANSI
-PUBLIC F64 cmLog10
-(
-F64          x
-)
-#else
-PUBLIC F64 cmLog10(x)
-F64           x;
-#endif
+F64 cmLog10(F64 x)
 {
 #if (defined(SUNOS)|| defined(WIN32)|| defined(WIN2K)|| defined (SS_LINUX))
    return ((F64) log10((F64)x));
@@ -203,6 +157,24 @@ F64           x;
 } /* end of cmLog10 */
 #endif /* SS_FLOAT */
 
+/*
+*
+*       Fun:   cmLog
+*
+*       Desc:  common primitive for computing the base 2 logrithm of x.
+*
+*       Ret:   log2(x)
+*
+*       Notes: None
+*
+*       File:  cm_math.c
+*
+*/
+float cmLog2(uint32_t x)
+{
+   return ((float) log2(x));
+}
+
 /**********************************************************************
          End of file
 **********************************************************************/