Usermode/libm - Wrap builtin log
authorJohn Hodge <[email protected]>
Sun, 9 Mar 2014 07:28:26 +0000 (15:28 +0800)
committerJohn Hodge <[email protected]>
Sun, 9 Mar 2014 07:28:26 +0000 (15:28 +0800)
Usermode/Libraries/libm.so_src/include_exp/math.h
Usermode/Libraries/libm.so_src/pow.c

index 349547e..d6d988f 100644 (file)
@@ -8,6 +8,16 @@
 #ifndef _LIBM__MATH_H_
 #define _LIBM__MATH_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern double  pow(double x, double y);
+extern double  exp(double x);
+extern double  log(double val);
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif
index f35d7c2..d968ca8 100644 (file)
@@ -16,3 +16,17 @@ double pow(double x, double y)
                return 1.0f;
        return __builtin_pow(x,y);
 }
+
+double exp(double y)
+{
+       if( y == 0.0f )
+               return 1.0f;
+       return __builtin_exp(y);
+}
+
+double log(double n)
+{
+       if(n == 1.0f)
+               return 0.0f;
+       return __builtin_log(n);
+}

UCC git Repository :: git.ucc.asn.au