Example #1
0
        private static void PrintSecondTaskCompare()
        {
            var sequenceLength        = 100;
            var alteredFloatSequence  = new AlteredFloatSequence(0.01f);
            var alteredDoubleSequence = new DoubleSequence(0.01d);

            alteredFloatSequence.SetNextResults(sequenceLength);
            alteredDoubleSequence.SetNextResults(sequenceLength);

            var alteredFloatResults  = alteredFloatSequence.GetResults();
            var alteredDoubleResults = alteredDoubleSequence.GetResults();

            Console.Out.WriteLine("Results:\n[Index]   [AlteredFloat]    [AlteredDouble]   [Difference]");

            for (int i = 0; i < sequenceLength; i++)
            {
                Console.Out.WriteLine(
                    $"{i}: {alteredFloatResults[i]}, {alteredDoubleResults[i]}, {alteredFloatResults[i] - alteredDoubleResults[i]}");
            }
        }
Example #2
0
        private static void PrintFirstTask()
        {
            var sequenceLength        = 100;
            var floatSequence         = new  FloatSequence(0.01f);
            var alteredFloatSequence  = new AlteredFloatSequence(0.01f);
            var doubleSequence        = new DoubleSequence(0.01d);
            var alteredDoubleSequence = new DoubleSequence(0.01d);

            floatSequence.SetNextResults(sequenceLength);
            doubleSequence.SetNextResults(sequenceLength);
            alteredFloatSequence.SetNextResults(sequenceLength);
            alteredDoubleSequence.SetNextResults(sequenceLength);

            var floatResults  = floatSequence.GetResults();
            var doubleResults = doubleSequence.GetResults();

            Console.Out.WriteLine("Results:\n[Index]   [Float]    [Double]   [Difference]");

            for (int i = 0; i < sequenceLength; i++)
            {
                Console.Out.WriteLine(
                    $"{i}: {floatResults[i]}, {doubleResults[i]}, {floatResults[i] - doubleResults[i]}");
            }
        }