当前位置:网站首页>Double. isNaN(double var)
Double. isNaN(double var)
2022-07-27 00:09:00 【Take a boat to see the sea】
Double Medium NaN Indicates that a is not a number (Not a number), Inquire about JAVA SE 18(Chapter 2. The Structure of the Java Virtual Machine) Specification document ,
Its official website JAVA SE 18 explain :

Popular said : NaN Used to express the result of illegal operation , such as 0/0. Depending on the floating point type , Contains two values Float.NaN and Double.Nan.
summary : What will happen NaN?
(1) 0/0
(2) Square a negative number ( Such as usage Math.sqr(-1))
(3) Logarithm of negative numbers ( Such as Math.log10(-1)).
(4) 3/0( The result after the test is positive infinity, It's a little strange. , Look at the official website and use it 0 And negative 0 It seems quite reasonable to say positive infinity and negative infinity , But with the previous definition ( The result of illegal operation is Nan) It's a bit contradictory ,)
NaN Features such as official website JAVA SE 18:
The general explanation is :NaN Is chaotic , So it has the following properties :
(1) You and yourself are not equal in value , That's the equation NaN === NaN return false;
(2) NaN Nor is it equal to any number NaN == X(X Can be any number ) Equation return false;
(3) As long as one of the two sides of the inequality is NaN, Then the inequality will return true.
The practice result proves : Notice that there is one on both sides of this final inequality Nan Will return as true The situation is limited to !=; barring >, < Symbol .
边栏推荐
- MVC three-tier architecture
- Simple SQL optimization
- Part II - C language improvement_ 9. Linked list
- 【面试:并发篇26:多线程:两阶段终止模式】volatile版本
- push to origin/master was rejected 错误解决方法
- Typesript generic constraint
- What are the use cases in the Internet of things industry in 2022?
- Question 152: product maximum subarray
- 关于可穿戴式NFT你应该知道的一切!
- What is Tencent cloud lightweight application server? What are the differences between CVM and ECS?
猜你喜欢

Meeting OA my meeting
![[Gorm] model relationship -hasone](/img/90/3069059ddd09dc538c10f76d659b08.png)
[Gorm] model relationship -hasone

Upload files to the server

New features of ES6

MySQL数据库复杂操作:数据库约束,查询/连接表操作
![[C language] array](/img/b7/fe090984af689e45cf3492ff8d4c61.png)
[C language] array

In depth interpretation of the investment logic of the consortium's participation in the privatization of Twitter

The place where the dream begins ---- first knowing C language (2)

大疆智图、CC生产了多份数据,如何合并为一份在图新地球进行加载

08 design of intelligent agricultural environmental monitoring system based on ZigBee
随机推荐
Part II - C language improvement_ 12. Packaging and use of dynamic / precision Library
Design of electronic scale based on 51 single chip microcomputer
Chapter 1 requirements analysis and SSM environment preparation
At 12:00 on July 17, 2022, the departure of love life on June 28 was basically completed, and it needs to rebound
[interview: concurrency 26: multithreading: two-phase termination mode] volatile version
4-4 对象生命周期
11_ Weather case - monitoring properties
In depth interpretation of the investment logic of the consortium's participation in the privatization of Twitter
Paging plug-in -- PageHelper
ES6新特性
Complete backpack and 01 Backpack
In simple terms, cchart's daily lesson - Lesson 59 of happy high school 4 comes to the same end by different ways, and the C code style of the colorful interface library
文件上传到服务器
简单的SQL优化
【C语言】数组
Section 6: introduction to cmake grammar
Method of setting QQ to blank ID
In simple terms, cchart daily lesson - happy high school lesson 57 new starting point, the old tree and new bud of colorful interface library
Share a regular expression
Analysis of encoding and decoding of encode() and decode(), common encoding and why encode and decode are needed