GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — programmingWithPythonCode/simple_datatypes/float_nan.py at main · thomasWeise/programmingWithPythonCode Expand file tree/ Copy pathfloat_nan.pyMore file actions 18 lines (17 loc) · 824 Bytes / Copy pathfloat_nan.pyFile metadata and controls18 lines (17 loc) · 824 Bytes 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 |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |