本文整理汇总了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));
}
示例2: getMaxConfidence
public int getMaxConfidence(Double[] arrayOfConfidence)
{
double maxValue = arrayOfConfidence.Max();
int maxIndex = arrayOfConfidence.ToList().IndexOf(maxValue);
return maxIndex;
}
示例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);
}