The program:

 class Program
{
static void Main()
{
const double infinity = double.PositiveInfinity;
const double negInfinity = double.NegativeInfinity;
const double nan = double.NaN;
const double max = double.MaxValue;
const double min = double.MinValue;
const double somePositive = 12343243252423.5234;
Console.WriteLine("max< infinity = {0}", max < infinity);
Console.WriteLine("somePositiv<infinity = {0}", somePositive < infinity);
Console.WriteLine("negInfinity<-somePositiv = {0}", negInfinity < -somePositive);
Console.WriteLine("negInfinity==-infinity = {0}", negInfinity == -infinity);
Console.WriteLine("min==-max = {0}", min == -max);
Console.WriteLine("min+max==0 = {0}", min + max == );
Console.WriteLine("negInfinity+infinity==0 = {0}", negInfinity + infinity == );
Console.WriteLine("negInfinity+infinity= {0}", negInfinity + infinity);
Console.WriteLine("nan+nan= {0}", nan + nan);
Console.WriteLine("max< nan = {0}", somePositive < infinity);
Console.WriteLine("max = {0}", max);
Console.WriteLine("min = {0}", min);
Console.WriteLine("infinity = {0}", infinity);
Console.WriteLine("negInfinity = {0}", negInfinity);
Console.WriteLine("nan<infinity = {0}", nan < infinity);
}
}

The result:

max< infinity = True
somePositiv<infinity = True
negInfinity<-somePositiv = True
negInfinity==-infinity = True
min==-max = True
min+max==0 = True
negInfinity+infinity==0 = False
negInfinity+infinity= NaN
nan+nan= NaN
max< nan = True
max = 1.79769313486232E+308
min = -1.79769313486232E+308
infinity = Infinity
negInfinity = -Infinity
nan<infinity = False

The Result of an Interesting and Useful Program on Floating Numbers的更多相关文章

  1. [Amazon] Program for Fibonacci numbers 斐波那契数列

    The Fibonacci numbers are the numbers in the following integer sequence. 0, 1, 1, 2, 3, 5, 8, 13, 21 ...

  2. 提高神经网络的学习方式Improving the way neural networks learn

    When a golf player is first learning to play golf, they usually spend most of their time developing ...

  3. How to detect and avoid memory and resources leaks in .NET applications

    By Fabrice Marguerie Despite what a lot of people believe, it's easy to introduce memory and resourc ...

  4. fio2.1.10--HOWTO

    1.0 Overview and history    ------------------------ fio was originally written to save me the hassl ...

  5. NMAP - A Stealth Port Scanner--reference

    http://nmap.org/bennieston-tutorial/ 实例:nmap -sP 192.168.21.* Contents 1  Introduction Nmap is a fre ...

  6. bsdasm

    bsdasm 来源 http://www.int80h.org/bsdasm/ Preface by G. Adam StanislavWhiz Kid Technomagic Assembly la ...

  7. Man手册--nmap

    目录 nmap使用手册 附录: nmap使用手册 附录: NMAP(1) Nmap Reference Guide NMAP(1) NAME nmap - Network exploration to ...

  8. selenium docs

    Note to the Reader - Docs Being Revised for Selenium 2.0! Introduction Test Automation for Web Appli ...

  9. [poj1113][Wall] (水平序+graham算法 求凸包)

    Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall ...

随机推荐

  1. C/C++学习笔记---高地址、低地址、大段字节序、小段字节序

    字节顺序是指占内存多于一个字节类型的数据在内存中的存放顺序,通常有小端.大端两种字节顺序. 小端字节序指低字节数据存放在内存低地址处,高字节数据存放在内存高地址处: 大端字节序是高字节数据存放在低地址 ...

  2. Sphinx的介绍和原理探索

    What/Sphinx是什么 定义 Sphinx是一个全文检索引擎. 特性 索引和性能优异 易于集成SQL和XML数据源,并可使用SphinxAPI.SphinxQL或者SphinxSE搜索接口 易于 ...

  3. Pyqt QListWidget 展示系统环境变量

    今天学习了下Pyqt的 QListWidget 控件 我们先看下这个图片 这张图片就是典型的listWidget效果,我们今天就仿这样布局新建个ListWidget 在网上找了个关于QListWidg ...

  4. [LeetCode] Validate Binary Search Tree (两种解法)

    Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as ...

  5. 解决 CentOS网卡eth0启用不了问题

    转自:http://www.centoscn.com/CentosBug/osbug/2014/0423/2850.html [root@localhost Desktop]# service net ...

  6. h264 profile & level

    转自:http://blog.csdn.net/sphone89/article/details/17492433 H.264 Profiles H.264有四种profile,每个profile支持 ...

  7. PowerDesigner(PowerDesigner15.1.0.2850)下载、安装以及破解

    转自:http://www.cnblogs.com/Fonkie/articles/1600662.html 一.先安装PowerDesigner15(PowerDesigner15.1.0.2850 ...

  8. pylab模式

    启动IPython时ipython --pylab就可以进入pylab模式,这种模式下画图时图片不会直接蹦出来,而是嵌在交互环境中,当然sypder里自动是pylab模式了

  9. hadoop中map和reduce的数量设置问题

    转载http://my.oschina.net/Chanthon/blog/150500 map和reduce是hadoop的核心功能,hadoop正是通过多个map和reduce的并行运行来实现任务 ...

  10. hash 分区的用途是什么?

    Hash partitioning enables easy partitioning of data that does not lend itself to rangeor list partit ...