當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。