The Labs \ Source Viewer \ SSCLI \ Microsoft.JScript \ LenientMathObject

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. namespace Microsoft.JScript
  16. {
  17.    
  18.     using System;
  19.    
  20.     public sealed class LenientMathObject : MathObject
  21.     {
  22.         public new const double E = 2.71828182845905;
  23.         public new const double LN10 = 2.30258509299405;
  24.         public new const double LN2 = 0.693147180559945;
  25.         public new const double LOG2E = 1.44269504088896;
  26.         public new const double LOG10E = 0.434294481903252;
  27.         public new const double PI = 3.14159265358979;
  28.         public new const double SQRT1_2 = 0.707106781186548;
  29.         public new const double SQRT2 = 1.4142135623731;
  30.        
  31.         public new object abs;
  32.         public new object acos;
  33.         public new object asin;
  34.         public new object atan;
  35.         public new object atan2;
  36.         public new object ceil;
  37.         public new object cos;
  38.         public new object exp;
  39.         public new object floor;
  40.         public new object log;
  41.         public new object max;
  42.         public new object min;
  43.         public new object pow;
  44.         public new object random;
  45.         public new object round;
  46.         public new object sin;
  47.         public new object sqrt;
  48.         public new object tan;
  49.        
  50.         internal LenientMathObject(ScriptObject parent, FunctionPrototype funcprot) : base(parent)
  51.         {
  52.             this.noExpando = false;
  53.             Type super = typeof(MathObject);
  54.             this.abs = new BuiltinFunction("abs", this, super.GetMethod("abs"), funcprot);
  55.             this.acos = new BuiltinFunction("acos", this, super.GetMethod("acos"), funcprot);
  56.             this.asin = new BuiltinFunction("asin", this, super.GetMethod("asin"), funcprot);
  57.             this.atan = new BuiltinFunction("atan", this, super.GetMethod("atan"), funcprot);
  58.             this.atan2 = new BuiltinFunction("atan2", this, super.GetMethod("atan2"), funcprot);
  59.             this.ceil = new BuiltinFunction("ceil", this, super.GetMethod("ceil"), funcprot);
  60.             this.cos = new BuiltinFunction("cos", this, super.GetMethod("cos"), funcprot);
  61.             this.exp = new BuiltinFunction("exp", this, super.GetMethod("exp"), funcprot);
  62.             this.floor = new BuiltinFunction("floor", this, super.GetMethod("floor"), funcprot);
  63.             this.log = new BuiltinFunction("log", this, super.GetMethod("log"), funcprot);
  64.             this.max = new BuiltinFunction("max", this, super.GetMethod("max"), funcprot);
  65.             this.min = new BuiltinFunction("min", this, super.GetMethod("min"), funcprot);
  66.             this.pow = new BuiltinFunction("pow", this, super.GetMethod("pow"), funcprot);
  67.             this.random = new BuiltinFunction("random", this, super.GetMethod("random"), funcprot);
  68.             this.round = new BuiltinFunction("round", this, super.GetMethod("round"), funcprot);
  69.             this.sin = new BuiltinFunction("sin", this, super.GetMethod("sin"), funcprot);
  70.             this.sqrt = new BuiltinFunction("sqrt", this, super.GetMethod("sqrt"), funcprot);
  71.             this.tan = new BuiltinFunction("tan", this, super.GetMethod("tan"), funcprot);
  72.         }
  73.     }
  74. }

Developer Fusion