FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programmingWithPythonCode/simple_datatypes/float_nan.py at main · thomasWeise/programmingWithPythonCode · GitHub
thomasWeise
programmingWithPythonCode
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
programmingWithPythonCode
/
simple_datatypes
/
float_nan.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (17 loc) · 824 Bytes
Breadcrumbs
programmingWithPythonCode
/
simple_datatypes
/
float_nan.py
Copy path
File metadata and controls
18 lines (17 loc) · 824 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from
math
import
inf
inf
-
1
# infinity - 1 is still infinity
inf
-
1e300
# infinity - big number is still infinity
inf
-
inf
# infinity - infinity is undefined == nan
inf
/
1e300
# infinity / big number is still infinity
inf
/
inf
# infinity / infinity is still infinity
0
*
inf
# 0 * infinity is undefined == nan
from
math
import
nan
nan
+
1
# undefined + anything = undefined
nan
+
inf
# undefined + anything = undefined
nan
==
1
# undefined does not equal anything
nan
!=
1
# undefined is unequal to anything
1
!=
1
# this is obviously False
nan
==
nan
# undefined does not equal anything, including itself
nan
!=
nan
# undefined is unequal to anything, including itself
inf
==
inf
# infinity equals infinity
inf
!=
inf
# infinity therefore does not "not equal" infinity
Back
|
FazBrowse Home
|
New Git URL