码迷,mamicode.com
首页 > 其他好文 > 详细

NaN

时间:2016-08-20 01:27:37      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

 1     function w(w){console.log(w)}    
 2     w(null == null);
 3     w(null === null);
 4     w(NaN == NaN); //false
 5     w(NaN === NaN); //false
 6     w(NaN); //NaN
 7     w(‘2‘ == 2) //true
 8     w(‘2‘ === 2); //false
 9     w(null == undefined) //true
10     w(null === undefined) //false

 ECMA-262_ECMAScript®2015 Language Specification

 

6.1.6
The  Number  type  has  exactly 18437736874454810627(that  is, 264-253+3) values,
representing  the  double-precision  64-bit  format  IEEE  754-2008values  as  specified  in  the  IEEE  Standard  for  Binary  Floating-Point Arithmetic,  except  that  the 9007199254740990(that  is, 253-2)  distinct  “Not-a-Number”  values of  the  IEEE Standard are represented in ECMAScript as a single special NaN value. (Note that the NaN value is produced by the program expression NaN.)
In some implementations, external code might be able to detect a difference between various Not-a-Number values, but such behaviour is implementation-dependent; to ECMAScript code, all NaN values are indistinguishable from each other.

NaN

标签:

原文地址:http://www.cnblogs.com/yuanjiangw/p/5789466.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!