public static IEnumerable <Fix64> ParallelizedCalculateIntegerSumUpToNumbers(this Fix64Calculator fix64Calculator, int[] numbers)
        {
            if (numbers.Length != Fix64Calculator.MaxDegreeOfParallelism)
            {
                throw new ArgumentException(
                          "Provide as many numbers as the degree of parallelism of Fix64Calculator is (" +
                          Fix64Calculator.MaxDegreeOfParallelism + ")");
            }

            var memory = new SimpleMemory(2 * Fix64Calculator.MaxDegreeOfParallelism);

            for (int i = 0; i < numbers.Length; i++)
            {
                memory.WriteInt32(Fix64Calculator.ParallelizedCalculateLargeIntegerSum_Int32NumbersStartIndex + i, numbers[i]);
            }

            fix64Calculator.ParallelizedCalculateIntegerSumUpToNumbers(memory);

            var results = new Fix64[Fix64Calculator.MaxDegreeOfParallelism];

            for (int i = 0; i < Fix64Calculator.MaxDegreeOfParallelism; i++)
            {
                var itemOutputStartIndex = Fix64Calculator.ParallelizedCalculateLargeIntegerSum_OutputInt32sStartIndex + i * 2;

                results[i] = Fix64.FromRawInts(new[]
                {
                    memory.ReadInt32(itemOutputStartIndex),
                    memory.ReadInt32(itemOutputStartIndex + 1)
                });
            }

            return(results);
        }
        public static Fix64 CalculateIntegerSumUpToNumber(this Fix64Calculator fix64Calculator, int input)
        {
            var memory = new SimpleMemory(2);

            memory.WriteInt32(Fix64Calculator.CalculateLargeIntegerSum_InputInt32Index, input);

            fix64Calculator.CalculateIntegerSumUpToNumber(memory);

            return(Fix64.FromRawInts(new[]
            {
                memory.ReadInt32(Fix64Calculator.CalculateLargeIntegerSum_OutputInt32Index),
                memory.ReadInt32(Fix64Calculator.CalculateLargeIntegerSum_OutputInt32Index + 1)
            }));
        }