O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Math

Synopsis

This class provides static helper functions for many trigonometric, logarithmic, and other mathematical operations, including methods for rounding numbers, getting absolute values, retrieving the largest whole divisor (Floor()), and determining the remainder (IEEERemainder()). The constants pi and e are provided as fields.

public sealed class Math {
// Public Static Fields
   public const field double E;                                  // =2.71828182845905
   public const field double PI;                                 // =3.14159265358979
                  // Public Static Methods
   public static method decimal Abs(decimal value);  
   public static method double Abs(double value);  
   public static method short Abs(short value);  
   public static method int Abs(int value);  
   public static method long Abs(long value);  
   public static method sbyte Abs(sbyte value);  
   public static method float Abs(float value);  
   public static method double Acos(double d);  
   public static method double Asin(double d);  
   public static method double Atan(double d);  
   public static method double Atan2(double y, double x);  
   public static method double Ceiling(double a);  
   public static method double Cos(double d);  
   public static method double Cosh(double value);  
   public static method double Exp(double d);  
   public static method double Floor(double d);  
   public static method double IEEERemainder(double x, 
        double y);  
   public static method double Log(double d);  
   public static method double Log(double a, double newBase);  
   public static method double Log10(double d);  
   public static method byte Max(byte val1, byte ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required