Example #1
0
File: Program.cs Project: epam/DFP
        static int Main(string[] args)
        {
            if (args.Length == 0)
            {
                //TestToString();
                //TestOldDecimal();
                SimpleBenchmark.Run();
                Double    binary64  = new Random().NextDouble();
                Decimal64 decimal64 = Decimal64.FromDouble(binary64);
                Console.WriteLine(decimal64);
                return(0);
            }
            else
            {
                if (args.Length != 3)
                {
                    Console.Error.WriteLine("Usage: <A> <op> <B>");
                    return(1);
                }

                var argA   = Decimal64.Parse(args[0]);
                var argB   = Decimal64.Parse(args[2]);
                var result = processOperation(args[1], argA, argB);

                Console.WriteLine(argA + "(=" + argA.ToUnderlying() + ") " + args[1] + " " +
                                  argB + "(=" + argB.ToUnderlying() + ") = " +
                                  result + "(=" + result.ToUnderlying() + ")");

                return(0);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            HdDateTime dt = new HdDateTime(2000, 1, 1, 1, 1, 1, 12);

            Console.WriteLine(dt.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            Console.WriteLine(dt.ToString("yyyy-MM-dd HH:mm:ss.ff"));

            SimpleBenchmark.Run();
            //Scratchpad();
        }
Example #3
0
        static void Main(string[] args)
        {
            //TestToString();
            //TestOldDecimal();
            SimpleBenchmark.Run();
            Double    binary64  = new Random().NextDouble();
            Decimal64 decimal64 = Decimal64.FromDouble(binary64);

            Console.WriteLine(decimal64);
        }