当前位置: 首页>>代码示例>>C#>>正文


C# Double.Max方法代码示例

本文整理汇总了C#中System.Double.Max方法的典型用法代码示例。如果您正苦于以下问题:C# Double.Max方法的具体用法?C# Double.Max怎么用?C# Double.Max使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Double的用法示例。


在下文中一共展示了Double.Max方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        public static void Main(string[] args)
        {
            string[] month = new string[12]{"Jan","Feb","Mar", "Apr", "may","Jun","Jul","Aug","Sep","Oct","Nov", "Dec"};
            Double[] sales = new Double[12];
            double sum = 0;

            Console.WriteLine("Enter the sales");
            for(int i=0;i<month.Length;i++)
            {
                sales[i] = Convert.ToDouble(Console.ReadLine());
                sum = sum + sales[i];
            }

            Console.WriteLine("S.no \t Month  \t Sales");
            Console.WriteLine("-------------------------------");

            for(int j=0;j<month.Length;j++)
            {
                Console.WriteLine("{0} \t {1}  \t\t {2}",j, month[j], sales[j]);
            }

            Console.WriteLine("Maximum sales recorded is on {0}", sales.Max());
            Console.WriteLine("Minimum sales recorded is on {0}", sales.Min());
            Console.WriteLine("Average sales recorded is on {0}", (sum/month.Length));
        }
开发者ID:nasreekar,项目名称:CSExercises,代码行数:25,代码来源:Ex32.cs

示例2: getMaxConfidence

 public int getMaxConfidence(Double[] arrayOfConfidence)
 {
     double maxValue = arrayOfConfidence.Max();
         int maxIndex = arrayOfConfidence.ToList().IndexOf(maxValue);
         return maxIndex;
 }
开发者ID:yeghiakoronian,项目名称:MusicGenreClassifier,代码行数:6,代码来源:NaiveBayesClassifier.cs

示例3: ShowTrainingData

        //Method that updates the chart with the data vectors      
        public void ShowTrainingData(Double[][] classA, Double[][] classB)
        {
            //create data series from the vectors
            var class1 = AlgorithmHelpers.JaggedToMD(classA);
            var class2 = AlgorithmHelpers.JaggedToMD(classB);

            //Compute the minimum and maximum numbers for the X axis
            var maxX = classA.Max(0)[0] > classB.Max(0)[0] ? classA.Max(0)[0] : classB.Max(0)[0];
            var minX = classA.Min(0)[0] < classB.Min(0)[0] ? classA.Min(0)[0] : classB.Min(0)[0];

            //Update the range of the X axis with the max and the min
            perceChart.RangeX = new Range((float)minX, (float)maxX);
            nnChart.RangeX = new Range((float)minX, (float)maxX);
            lsChart.RangeX = new Range((float)minX, (float)maxX);

            //Update the Perceptron chart with the loaded data
            perceChart.UpdateDataSeries("class1", class1);
            perceChart.UpdateDataSeries("class2", class2);
            //Update the BackPropagation chart with the loaded data
            nnChart.UpdateDataSeries("class1", class1);
            nnChart.UpdateDataSeries("class2", class2);
            //Update the LS chart
            lsChart.UpdateDataSeries("class1", class1);
            lsChart.UpdateDataSeries("class2", class2);
        }
开发者ID:salufa,项目名称:MachineLearning,代码行数:26,代码来源:MainForm.cs


注:本文中的System.Double.Max方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。