Python Forum
Python sys.float_info.min value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python sys.float_info.min value
#1
There is sys.float_info in Python:

>>> import sys
>>> sys.float_info
sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)
>>> sys.float_info.min
2.2250738585072014e-308
Python seems to recognise this value to be larger than zero:

>>> 0 < sys.float_info.min
True
However, if I add this greater than zero value to integer it's not making value greater:

>>> 1 < (1 + sys.float_info.min)
False
>>> 1 == (1 + sys.float_info.min)
True
Any explanation why is that (some precision and/or normalised thingy)?

Technical stuff aside, this is somehow contra-intuitive (being larger than zero but not impacting value comparison).
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
Python sys.float_info.min value - by perfringo - Mar-23-2020, 05:58 AM
RE: Python sys.float_info.min value - by perfringo - Mar-27-2020, 08:36 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020