Exemplo n.º 1
0
        public void Table(double a, double b, double h, IMathFunc func)
        {
            double x = a;

            while (x <= b)
            {
                Console.WriteLine("{0,10}{1,10}", x, func.F(x));
                x += h;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Main entry funciton
        /// </summary>
        /// <param name="args">command line args</param>
        static void Main(string[] args)
        {
            // initial resolutions
            ISingleton s = Program.GetContainer().Resolve <ISingleton>();
            IMathFunc  m = Program.GetContainer().Resolve <IMathFunc>();

            s.SetVal(m.MathFunc(1.1, 2.2).ToString());
            s = null;

            // test singleton
            s = Program.GetContainer().Resolve <ISingleton>();
            Console.WriteLine(string.Format("Singleton value: {0} (should be 3.3)", s.GetVal()));
            Console.ReadLine();
        }
Exemplo n.º 3
0
 public CExpression(IMathFunc op)
 {
     _op = op;
 }
Exemplo n.º 4
0
 public CArg_BinOp(IMathFunc op) :
     base(op.StartLineIndex, op.EndLineIndex)
 {
     _op = op;
 }
Exemplo n.º 5
0
 public SBuildElem(IMathFunc op)
 {
     Token = null;
     Op    = op;
 }