Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132908: add math.normal/subnormal() functions#132935

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
skirpichev wants to merge7 commits intopython:main
base:main
Choose a base branch
Loading
fromskirpichev:isnormal-subnormal/132908

Conversation

skirpichev
Copy link
Member

@skirpichevskirpichev commentedApr 25, 2025
edited by github-actionsbot
Loading

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

Just some cosmetic nits.

skirpichevand others added2 commitsApril 25, 2025 17:45
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@picnixz
Copy link
Member

So, we have some known buildbots issues. I'll wait for it to be solved and then once it's ok for them, I'll merge it.

@skirpichev
Copy link
MemberAuthor

Technically it's very trivial pr, yet I would appreciate a second look from someone.

Maybe we should be more vague andnot define in any way normal/subnormal meaning (i.e. not reference sys.float_info). (Or mention this as CPython implementation detail.) E.g. should all Python implementations support subnormals?

Copy link
Contributor

@StanFromIrelandStanFromIreland left a comment

Choose a reason for hiding this comment

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

IMO the docs and implementation are fine, everything is explained well.

Copy link
MemberAuthor

@skirpichevskirpichev left a comment
edited
Loading

Choose a reason for hiding this comment

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

Maybe we can replace "floating-point number" with just a "number" (as integer are automatically converted to floats)?

Comment on lines +56 to +57
:func:`isnormal(x) <isnormal>` Check if *x* is a normal floating-point number
:func:`issubnormal(x) <issubnormal>` Check if *x* is a subnormal floating-point number
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Suggested change
:func:`isnormal(x) <isnormal>` Check if *x* is a normalfloating-pointnumber
:func:`issubnormal(x) <issubnormal>` Check if *x* is a subnormalfloating-pointnumber
:func:`isnormal(x) <isnormal>` Check if *x* is a normal number
:func:`issubnormal(x) <issubnormal>` Check if *x* is a subnormal number

Comment on lines +381 to +383
Return ``True`` if *x* is a normal floating-point number, that is a finite
nonzero number that is not a subnormal (see :func:`issubnormal`).
Return ``False`` otherwise.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Suggested change
Return ``True`` if *x* is a normalfloating-pointnumber, that is a finite
nonzero number that is not a subnormal (see:func:`issubnormal`).
Return ``False`` otherwise.
Return ``True`` if *x* is a normal number, that is a finite
nonzero number that is not a subnormal (see:func:`issubnormal`).
Return ``False`` otherwise.

Comment on lines +390 to +392
Return ``True`` if *x* is a subnormal floating-point 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.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Suggested change
Return ``True`` if *x* is a subnormalfloating-pointnumber, 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.
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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@picnixzpicnixzpicnixz approved these changes

@StanFromIrelandStanFromIrelandStanFromIreland approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@skirpichev@picnixz@StanFromIreland

[8]ページ先頭

©2009-2025 Movatter.jp