Skip to content

gh-135308: clarify math.issubnormal() description #135324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ Floating point manipulation functions
.. function:: issubnormal(x)

Return ``True`` if *x* is a subnormal number, that is a finite
nonzero number with a magnitude smaller than the smallest positive normal
number, see :data:`sys.float_info.min`. Return ``False`` otherwise.
nonzero number with a magnitude smaller than :data:`sys.float_info.min`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magnitude is an integer, it'll be smaller than sys.float_info.min if x is smaller than 1.

Suggested change
nonzero number with a magnitude smaller than :data:`sys.float_info.min`.
nonzero number smaller than :data:`sys.float_info.min`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the original meant “smaller than the magnitude of the smallest positive normal number”, but that's just extra words.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be incorrect, as any finite negative floating-point number will satisfy your definition.

The magnitude is an integer

No. It's about absolute value of the float. See e.g. copysign() docs.

Return ``False`` otherwise.

.. versionadded:: next

Expand Down
Loading