コード例 #1
0
ファイル: Program.cs プロジェクト: TytkoDominik/mownit
        private static void PrintSecondTaskFloat()
        {
            var sequenceLength       = 100;
            var floatSequence        = new  FloatSequence(0.01f);
            var alteredFloatSequence = new AlteredFloatSequence(0.01f);

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

            var floatResults        = floatSequence.GetResults();
            var alteredFloatResults = alteredFloatSequence.GetResults();

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

            for (int i = 0; i < sequenceLength; i++)
            {
                Console.Out.WriteLine(
                    $"{i}: {floatResults[i]}, {alteredFloatResults[i]}, {floatResults[i] - alteredFloatResults[i]}");
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: TytkoDominik/mownit
        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]}");
            }
        }