-11

MDN puts the isNaN() function in a nutshell:

"is this value, when coerced to a numeric value, an IEEE-754 'Not A Number' value?"

What is IEEE-754 ?

P.S. I have read and researched quite a bit about isNaN , and have seen THIS, thread too. I just don't know what IEEE-754 is supposed to mean.

Thank you.

Community
  • 1
  • 1
Alexander Solonik
  • 9,838
  • 18
  • 76
  • 174
  • 6
    What do you mean “What is IEEE-754”? Have you Googled this? – Sebastian Simon Oct 09 '15 at 14:06
  • 2
    There’s even an [ieee-754 tag](http://stackoverflow.com/tags/ieee-754/info) on SO. – Sebastian Simon Oct 09 '15 at 14:07
  • When in doubt, read [the wiki](https://en.wikipedia.org/wiki/IEEE_floating_point), and when in great doubt, read [the spec](http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=4610935&url=http%3A%2F%2Fieeexplore.ieee.org%2Fstamp%2Fstamp.jsp%3Ftp%3D%26arnumber%3D4610935). – Boaz Oct 09 '15 at 14:08
  • Thanks guys , will keep that in mind . – Alexander Solonik Oct 09 '15 at 14:09
  • Please can we add the functionality to SO that takes the title of a question and submits it to a search engine thereby showing potentially matching answers before submission? – KevinDTimm Oct 09 '15 at 14:12
  • https://www.google.co.in/?gfe_rd=cr&ei=ucoXVoGwFMLDoAPE4I-wBw&gws_rd=ssl#q=what+is+ieee+754 google page for your title – niko Oct 09 '15 at 14:13
  • @KevinDTimm lookup the subject on [meta](http://meta.stackoverflow.com/) and post your suggestion there if it's not a feature request already. – Boaz Oct 09 '15 at 14:16
  • @Boaz - going there now – KevinDTimm Oct 09 '15 at 14:17
  • 1
    While strictly correct, the mention of IEEE-754 is something of a red herring. *NaN* represents a generic "this is not a number" value in much the same way that *undefined* means the value is undefined even though it has been assigned the *undefined* value. Read the [*spec*](http://ecma-international.org/ecma-262/6.0/index.html#sec-isnan-number), essentially *isNaN* returns false if a value can be converted to a number value other than NaN. Otherwise it returns true. – RobG Oct 09 '15 at 14:23
  • @RobG thanks .... :) – Alexander Solonik Oct 09 '15 at 14:26
  • If you're interested in the long answer, read this: [What Every Computer Scientist Should Know About Floating-Point Arithmetic](http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html). – Lucas Trzesniewski Oct 10 '15 at 13:44
  • @LucasTrzesniewski thanks for contributing .. will bookmark that. – Alexander Solonik Oct 10 '15 at 14:40

1 Answers1

3

IEEE 754 is the Standard for Binary Floating-Point Arithmetic by The Institute of Electrical and Electronics Engineers. It describes how computers deal with numbers.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335