Skip to content

Commit fa99c81

Browse files
committed
adding more tricky questions
1 parent 8cc3ff0 commit fa99c81

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Javascript/Tricky-JS-Problems/Collection-of-Tricky-JS-Questlions.md

+20
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,26 @@ Attempting to do comparison (less than, greater than, and so on) operations betw
246246
247247
Tests for equality (equal to, not equal to) are never signalling so using them will not cause an exception. If you have a regular number `x`, then `x == x` will always be true. If `x` is a `NaN`, then `x == x` will always be false. It's giving you a way to detect `NaN` easily (quietly).
248248

249+
#### Important References to Standards
250+
251+
The ECMAScript (JavaScript) standard specifies that `Numbers` are [IEEE 754](http://en.wikipedia.org/wiki/IEEE_754) floats, which include `NaN` as a possible value.
252+
253+
### [ECMA 262 5e Section 4.3.19](http://ecma262-5.com/ELS5_Section_4.htm#Section_4.3.19): Number value
254+
255+
primitive value corresponding to a double-precision 64-bit binary format IEEE 754 value.
256+
257+
### [ECMA 262 5e Section 4.3.23](http://ecma262-5.com/ELS5_Section_4.htm#Section_4.3.23): NaN
258+
259+
Number value that is a IEEE 754 "Not-a-Number" value.
260+
261+
### [IEEE 754](http://en.wikipedia.org/wiki/IEEE_754) on Wikipedia
262+
263+
The IEEE Standard for Floating-Point Arithmetic is a technical standard established by the Institute of Electrical and Electronics Engineers and the most widely used standard for floating-point computation [...]
264+
265+
The standard defines
266+
267+
- _arithmetic formats_: sets of binary and decimal floating-point data, which consist of finite numbers (including signed zeros and subnormal numbers), infinities, and **special "not a number" values (NaNs)**
268+
249269
---
250270

251271
Question: What is `2 in [1,2]`

0 commit comments

Comments
 (0)