本文整理汇总了C#中System.Double.MaxValue字段的典型用法代码示例。如果您正苦于以下问题:C# Double.MaxValue字段的具体用法?C# Double.MaxValue怎么用?C# Double.MaxValue使用的例子?那么恭喜您, 这里精选的字段代码示例或许可以为您提供帮助。您也可以进一步了解该字段所在类System.Double
的用法示例。
在下文中一共展示了Double.MaxValue字段的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: return
public class Temperature {
public static double MinValue {
get {
return Double.MinValue;
}
}
public static double MaxValue {
get {
return Double.MaxValue;
}
}
// The value holder
protected double m_value;
public double Value {
get {
return m_value;
}
set {
m_value = value;
}
}
public double Celsius {
get {
return (m_value-32.0)/1.8;
}
set {
m_value = 1.8*value+32.0;
}
}
}
示例2: Main
//引入命名空间
using System;
public class Example
{
public static void Main()
{
double result1 = 7.997e307 + 9.985e307;
Console.WriteLine("{0} (Positive Infinity: {1})",
result1, Double.IsPositiveInfinity(result1));
double result2 = 1.5935e250 * 7.948e110;
Console.WriteLine("{0} (Positive Infinity: {1})",
result2, Double.IsPositiveInfinity(result2));
double result3 = Math.Pow(1.256e100, 1.34e20);
Console.WriteLine("{0} (Positive Infinity: {1})",
result3, Double.IsPositiveInfinity(result3));
}
}
输出:
Infinity (Positive Infinity: True) Infinity (Positive Infinity: True) Infinity (Positive Infinity: True)