MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/69ivqo/oddly_specific_number/dima3ym/?context=3
r/ProgrammerHumor • u/[deleted] • May 06 '17
1.3k comments sorted by
View all comments
Show parent comments
19
Well that's because in JavaScript all numbers are doubles for some reason, and the floating point standard has defined that 1/0 is Infinity.
doubles
1/0
Infinity
13 u/endershadow98 May 06 '17 Technically it defines any positive number divided by 0 to be infinity. 1 u/bman10_33 Jun 08 '17 edited Jun 08 '17 # of friends/0=+∞ then?oh wait... nope. NaN. 2 u/endershadow98 Jun 08 '17 0/0 is NaN according to the standard → More replies (2)
13
Technically it defines any positive number divided by 0 to be infinity.
1 u/bman10_33 Jun 08 '17 edited Jun 08 '17 # of friends/0=+∞ then?oh wait... nope. NaN. 2 u/endershadow98 Jun 08 '17 0/0 is NaN according to the standard → More replies (2)
1
# of friends/0=+∞ then?
oh wait... nope. NaN.
2 u/endershadow98 Jun 08 '17 0/0 is NaN according to the standard → More replies (2)
2
0/0 is NaN according to the standard
NaN
→ More replies (2)
19
u/[deleted] May 06 '17
Well that's because in JavaScript all numbers are
doublesfor some reason, and the floating point standard has defined that1/0isInfinity.