现在的位置: 首页 > 综合 > 正文

System.Double怎么了?

2013年01月05日 ⁄ 综合 ⁄ 共 362字 ⁄ 字号 评论关闭
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
double d1 = 4.08426213706027E+304;
double d2 = 1.7189571678554E+253;
double d3 = d1 - d2;
Console.WriteLine ((d1.CompareTo(d3) == 0) ? "Equal" : "Unequal");
}
}
}

why? 怎么可以相等啊?求懂的人解答。

http://files.cnblogs.com/deepleo/ConsoleApplication3.zip

抱歉!评论已关闭.