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 ...
随机推荐
- 微信token验证失败的解决方法
一.问题由来 在使用URL和Token启用微信公众平台开发模式消息接口的时候,我们会碰到下面三种情况 1. token校验失败 这样回头检查一下各项配置是否正确.如果确定配置没有问题,请按下面的方法检 ...
- 【JAVA 文件概述】
一.概述 使用此类的原因: 该类将文件或者文件夹封装成对象.方便对文件与文件夹的属性信息进行操作.File对象作为参数传递给流的构造函数.要求:使用File类的常用方法. windows平台下,目录分 ...
- poj 1006:Biorhythms(水题,经典题,中国剩余定理)
Biorhythms Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 110991 Accepted: 34541 Des ...
- 在MAVEN仓库中添加ORACLE JDBC驱动
本文转载自 http://www.cnblogs.com/leiOOlei/archive/2013/10/21/3380568.html 因为已经是第二次遇到,所以COPY过来,怕以后别人的BLOG ...
- 消息队列通信,王明学learn
消息队列通信 消息队列就是一个消息(一个结构)的链表.而一条消息则可看作一个记录,具有特定的格式.进程可以从中按照一定的规则添加新消息:另一些进程则可以从消息队列中读走消息. 每一个消息都是一个结构体 ...
- 第一次尝试用 Live Writer 写博客
之前在官网上下载了最新版的Windows Live Writer,可是安装不了,就在其他网站下了一个试试,可以安装,不过却是2009年的版本,很不喜欢,我希望能体验最新版的,回头还得重新下个最新版的安 ...
- [荐]使用jQuery清空file文件域
file是文本域,我们一般都会使用它来上传文件,在上传文件时我们需要验证,验证完成后,如果存在错误,为了防止将错误信息也上传上去,我们总是希望能够将其清空.但是在IE中,为了安全起见它是不允许我们改变 ...
- LeetCode——Single Number(找出数组中只出现一次的数)
问题: Given an array of integers, every element appears twice except for one. Find that single one. No ...
- socket编程学习
socket: 也称作套接字,应用程序通常通过套接字向网络发出请求或者应答网络请求. 常用的套接字API函数: 1.socket(): 函数原型为:int socket(int domain, int ...
- pythonchallenge之C++学习篇-00
前言 最近学习下C++,之前是python的用户,python解释器有诸多实现,其中最出名的要数C实现了,而且很多python的扩展模块可能要用C或者C++来写的,所以很有必要学习下C++了 为了避免 ...