2002-03-18 Dan Lewis <dihlewis@yahoo.co.uk>
authorDan Lewis <dan@mono-cvs.ximian.com>
Mon, 18 Mar 2002 16:55:15 +0000 (16:55 -0000)
committerDan Lewis <dan@mono-cvs.ximian.com>
Mon, 18 Mar 2002 16:55:15 +0000 (16:55 -0000)
* Math.cs, Linux.cs: changed to use icall instead of PAL.

svn path=/trunk/mcs/; revision=3192

mcs/class/corlib/Linux/ChangeLog
mcs/class/corlib/Linux/Linux.cs
mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Math.cs

index dbc60987da8fd9484539f0d5d4d6cc5c7e47fdf3..96eb5e7cdedd95dce22c20c93861878d9e6b160f 100644 (file)
@@ -1,3 +1,7 @@
+2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
+
+       * Linux.cs: Removed math methods (now in System.Math).
+
 2002-01-23  Dick Porter  <dick@ximian.com>
 
        * Linux.cs: GetFileTime and SetFileTime need to be static
index fe9e0828396d98db50773598b7e4d6bc55bbdac4..86a1cfc475ace53ae1ee4496a1c54ba8324479b1 100644 (file)
@@ -480,50 +480,5 @@ namespace System.PAL
 
                [DllImport("libc", EntryPoint="getpid")]
                private unsafe static extern int _getPid();
-
-               [ DllImport("libm", EntryPoint="acos") ]
-               public extern static double Acos(double d);
-
-               [ DllImport("libm", EntryPoint="asin") ]
-               public extern static double Asin(double d);
-
-               [ DllImport("libm", EntryPoint="atan") ]
-               public extern static double Atan(double d);
-
-               [ DllImport("libm", EntryPoint="atan2") ]
-               public extern static double Atan2(double y, double x);
-
-               [ DllImport("libm", EntryPoint="cos") ]
-               public extern static double Cos(double d);
-
-               [ DllImport("libm", EntryPoint="cosh") ]
-               public extern static double Cosh(double d);
-
-               [ DllImport("libm", EntryPoint="exp") ]
-               public extern static double Exp(double d);
-
-               [ DllImport("libm", EntryPoint="log") ]
-               public extern static double Log(double d);
-
-               [ DllImport("libm", EntryPoint="log10") ]
-               public extern static double Log10(double d);
-
-               [ DllImport("libm", EntryPoint="pow") ]
-               public extern static double Pow(double x, double y);
-
-               [ DllImport("libm", EntryPoint="sin") ]
-               public extern static double Sin(double d);
-
-               [ DllImport("libm", EntryPoint="sinh") ]
-               public extern static double Sinh(double d);
-
-               [ DllImport("libm", EntryPoint="sqrt") ]
-               public extern static double Sqrt(double d);
-
-               [ DllImport("libm", EntryPoint="tan") ]
-               public extern static double Tan(double d);
-
-               [ DllImport("libm", EntryPoint="tanh") ]
-               public extern static double Tanh(double d);
        }
 }
index c4b095be4fb56f4269711acb0a77de0b4d5e5b03..00208ea3a18dcea03884e1170bcc0b247285d316 100644 (file)
@@ -1,3 +1,7 @@
+2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
+       
+       * Math.cs: changed to use icall instead of PAL.
+
 2002-03-18  Dietmar Maurer  <dietmar@ximian.com>
 
        * Double.cs: added check for NaN (Bug [22082])
index 4b9b5808487eaf242d1782c96f50900edab45714..f6f231ee7cb38b0d812546b7cb55921edb50bb02 100644 (file)
@@ -3,14 +3,14 @@
 //
 // Author:
 //   Bob Smith (bob@thestuff.net)
+//   Dan Lewis (dihlewis@yahoo.co.uk)
 //
 // (C) 2001 Bob Smith.  http://www.thestuff.net
 //
 
 using System;
-using System.PAL;
 using System.Globalization;
-using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
 
 namespace System
 {
@@ -56,49 +56,11 @@ namespace System
                         return (short)((value < 0)? -value: value);
                 }
 
-                public static double Acos(double d)
-                {
-                        if (d < -1 || d > 1) return Double.NaN;
-                        return OpSys.Acos(d);
-                }
-
-                public static double Asin(double d)
-                {
-                        if (d < -1 || d > 1) return Double.NaN;
-                        return OpSys.Asin(d);
-                }
-
-                public static double Atan(double d)
-               {
-                       return OpSys.Atan(d);
-               }
-
-                public static double Atan2(double y, double x)
-               {
-                       return OpSys.Atan2(y, x);
-               }
-
                 public static double Ceiling(double a)
                 {
                         double b = (double)((long)a);
                         return (b < a)? b+1: b;
                 }
-
-                public static double Cos(double d)
-               {
-                       return OpSys.Cos(d);
-               }
-
-                public static double Cosh(double value)
-               {
-                       return OpSys.Cosh(value);
-               }
-
-                public static double Exp(double d)
-               {
-                       return OpSys.Exp(d);
-               }
-
                 public static double Floor(double d) {
                    return (double)((long)d) ;
                 }
@@ -110,26 +72,13 @@ namespace System
                         if (r != 0) return r;
                         return (x > 0)? 0: -0;
                 }
-
-                public static double Log(double d)
-                {
-                        if (d == 0) return Double.NegativeInfinity;
-                        else if (d < 0) return Double.NaN;
-                        return OpSys.Log(d);
-                }
                 public static double Log(double a, double newBase)
                 {
                         if (a == 0) return Double.NegativeInfinity;
                         else if (a < 0) return Double.NaN;
-                        return OpSys.Log(a)/OpSys.Log(newBase);
+                        return Log(a)/Log(newBase);
                 }
 
-                public static double Log10(double d)
-                {
-                        if (d == 0) return Double.NegativeInfinity;
-                        else if (d < 0) return Double.NaN;
-                        return OpSys.Log10(d);
-                }
                 public static byte Max(byte val1, byte val2)
                 {
                         return (val1 > val2)? val1: val2;
@@ -219,11 +168,6 @@ namespace System
                         return (val1 < val2)? val1: val2;
                 }
 
-                public static double Pow(double x, double y)
-               {
-                       return OpSys.Pow(x, y);
-               }
-
                 public static decimal Round(decimal d)
                 {
                         decimal r = (decimal)((long)d);
@@ -315,30 +259,51 @@ namespace System
                         return (value == 0)? 0: -1;
                 }
 
-                public static double Sin(double a)
-               {
-                       return OpSys.Sin(a);
-               }
+               // internal calls 
 
-                public static double Sinh(double value)
-               {
-                       return OpSys.Sinh(value);
-               }
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Sin (double x);
 
-                public static double Sqrt(double d) 
-                {
-                        if (d < 0) return Double.NaN;
-                        return OpSys.Sqrt(d);
-                }
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Cos (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Tan (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Sinh (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Cosh (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Tanh (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Acos (double x);
+               
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Asin (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Atan (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Atan2 (double y, double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Exp (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Log (double x);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Log10 (double x);
 
-                public static double Tan(double a)
-               {
-                       return OpSys.Tan(a);
-               }
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Pow (double x, double y);
 
-                public static double Tanh(double value)
-               {
-                       return OpSys.Tanh(value);
-               }
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+                public extern static double Sqrt (double x);
         }
 }