Usermode/libm - Stubbed up a quick libm (using gcc builtins)
[tpg/acess2.git] / Usermode / Libraries / libm.so_src / pow.c
diff --git a/Usermode/Libraries/libm.so_src/pow.c b/Usermode/Libraries/libm.so_src/pow.c
new file mode 100644 (file)
index 0000000..f35d7c2
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Acess2 C Library (Maths)
+ * - By John Hodge (thePowersGang)
+ *
+ * pow.c
+ * - pow(), powf() and powl()
+ */
+#include <math.h>
+
+// === CODE ===
+double pow(double x, double y)
+{
+       if( x == 1.0f )
+               return 1.0f;
+       if( y == 0.0f )
+               return 1.0f;
+       return __builtin_pow(x,y);
+}

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