Procházet zdrojové kódy

Merge pull request #1739 from farism/master

Add System.Math.Cbrt
Brian Fiete před 2 roky
rodič
revize
a2c340cbae
2 změnil soubory, kde provedl 14 přidání a 0 odebrání
  1. 2 0
      BeefLibs/corlib/src/Math.bf
  2. 12 0
      BeefRT/rt/Math.cpp

+ 2 - 0
BeefLibs/corlib/src/Math.bf

@@ -221,6 +221,8 @@ namespace System
             
             
         public static extern float Sqrt(float f);
         public static extern float Sqrt(float f);
         public static extern double Sqrt(double d);
         public static extern double Sqrt(double d);
+		public static extern float Cbrt(float f);
+        public static extern double Cbrt(double d);
 		public static extern float Log(float f);
 		public static extern float Log(float f);
         public static extern double Log(double d);
         public static extern double Log(double d);
 		public static extern float Log10(float f);
 		public static extern float Log10(float f);

+ 12 - 0
BeefRT/rt/Math.cpp

@@ -37,6 +37,8 @@ namespace bf
 			BFRT_EXPORT static double Round(double a);
 			BFRT_EXPORT static double Round(double a);
 			BFRT_EXPORT static float Sqrt(float f);
 			BFRT_EXPORT static float Sqrt(float f);
 			BFRT_EXPORT static double Sqrt(double d);
 			BFRT_EXPORT static double Sqrt(double d);
+			BFRT_EXPORT static float Cbrt(float f);
+			BFRT_EXPORT static double Cbrt(double d);
 			BFRT_EXPORT static float Log(float d);
 			BFRT_EXPORT static float Log(float d);
 			BFRT_EXPORT static double Log(double d);
 			BFRT_EXPORT static double Log(double d);
 			BFRT_EXPORT static float Log10(float d);
 			BFRT_EXPORT static float Log10(float d);
@@ -193,6 +195,16 @@ double Math::Sqrt(double d)
 	return sqrt(d);
 	return sqrt(d);
 }
 }
 
 
+float Math::Cbrt(float f)
+{
+	return cbrtf(f);
+}
+
+double Math::Cbrt(double d)
+{
+	return cbrt(d);
+}
+
 float Math::Log(float d)
 float Math::Log(float d)
 {
 {
 	return logf(d);
 	return logf(d);