The Result of an Interesting and Useful Program on Floating Numbers
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的更多相关文章
- [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 ...
- 提高神经网络的学习方式Improving the way neural networks learn
When a golf player is first learning to play golf, they usually spend most of their time developing ...
- 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 ...
- fio2.1.10--HOWTO
1.0 Overview and history ------------------------ fio was originally written to save me the hassl ...
- NMAP - A Stealth Port Scanner--reference
http://nmap.org/bennieston-tutorial/ 实例:nmap -sP 192.168.21.* Contents 1 Introduction Nmap is a fre ...
- bsdasm
bsdasm 来源 http://www.int80h.org/bsdasm/ Preface by G. Adam StanislavWhiz Kid Technomagic Assembly la ...
- Man手册--nmap
目录 nmap使用手册 附录: nmap使用手册 附录: NMAP(1) Nmap Reference Guide NMAP(1) NAME nmap - Network exploration to ...
- selenium docs
Note to the Reader - Docs Being Revised for Selenium 2.0! Introduction Test Automation for Web Appli ...
- [poj1113][Wall] (水平序+graham算法 求凸包)
Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall ...
随机推荐
- 三、jQuery--jQuery基础--jQuery基础课程--第9章 jQuery 常用插件
1.表单验证插件——validate 该插件自带包含必填.数字.URL在内容的验证规则,即时显示异常信息,此外,还允许自定义验证规则,插件调用方法如下:$(form).validate({option ...
- Jquery学习笔记--性能优化建议
一.选择器性能优化建议 1. 总是从#id选择器来继承 这是jQuery选择器的一条黄金法则.jQuery选择一个元素最快的方法就是用ID来选择了. 1 $('#content').hide(); 或 ...
- 常用的数据统计Sql 总结(转)
转:http://www.cnblogs.com/zhangweizhong/p/5577842.html 最近刚在搞一个BI的项目,里面需要大量的sql 数据统计相关运用,加深了我又对SQL的理解与 ...
- HTML5学习之文档结构和语义(一)
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- dbca:Exception in thread "main" java.lang.UnsatisfiedLinkError: get
在64位的操作系统安装oracle10g 软件安装完成后,使用dbca建库的时候报下面的错: $ dbcaUnsatisfiedLinkError exception loading native l ...
- Implementing Navigation with UINavigationController
Implementing Navigation with UINavigationController Problem You would like to allow your users to mo ...
- Mysql常用命令详解
Mysql安装目录 数据库目录 /var/lib/mysql/ 配置文件 /usr/share/mysql(mysql.server命令及配置文件) 相关命令 /usr/bin(mysqladmin ...
- 提高WPF程序性能的几条建议
这篇博客将介绍一些提高WPF程序的建议(水平有限,如果建议有误,请指正.) 1. 加快WPF程序的启动速度: (1).减少需要显示的元素数量,去除不需要或者冗余的XAML元素代码. (2).使用UI虚 ...
- Linggle: 英语写作学习搜索引擎
Linggle 搜索引擎是一个可用于英语写作的语法.句子工具,可帮助学习者分析更准确的英文写作建议,能够根据词性来推测短句和句子,可精准的分享出完整英文句子如何撰写. Linggle 是台湾学术团队研 ...
- Educational Codeforces Round 3 E. Minimum spanning tree for each edge LCA/(树链剖分+数据结构) + MST
E. Minimum spanning tree for each edge Connected undirected weighted graph without self-loops and ...