GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-132908: Add math.isnormal/issubnormal() functions by skirpichev · Pull Request #132935 · python/cpython

Conversation

@skirpichev

@skirpichev skirpichev commented Apr 25, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Have math.isnormal() and, perhaps, math.issubnormal()? #132908

📚 Documentation preview 📚: https://cpython-previews--132935.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@skirpichev
pythongh-132908: add math.normal/subnormal() functions
9d14505
@bedevere-app bedevere-app Bot added the awaiting review label Apr 25, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Apr 25, 2025
Have math.isnormal() and, perhaps, math.issubnormal()? #132908
Closed
@skirpichev
oops, test name
7350b25
StanFromIreland
StanFromIreland reviewed Apr 25, 2025
View reviewed changes
Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2025-04-25-16-06-53.gh-issue-132908.wV5rja.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

skirpichev
skirpichev commented Apr 25, 2025
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2025-04-25-16-06-53.gh-issue-132908.wV5rja.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

skirpichev
skirpichev commented Apr 25, 2025
View reviewed changes
Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

skirpichev
skirpichev commented Apr 25, 2025
View reviewed changes
Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@skirpichev @StanFromIreland
Apply suggestions from code review
4eb3669
Co-authored-by: Stan Ulbrych <[email protected]>
picnixz
picnixz approved these changes Apr 25, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mathmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mathmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mathmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/mathmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Apr 25, 2025
skirpichev and others added 2 commits April 25, 2025 17:45
@skirpichev @picnixz
Apply suggestions from code review
37b3345
Co-authored-by: Bénédikt Tran <[email protected]>
@skirpichev @picnixz
Apply suggestions from code review
e318087
Co-authored-by: Bénédikt Tran <[email protected]>
@picnixz

picnixz commented Apr 25, 2025

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@skirpichev

skirpichev commented Apr 25, 2025

Copy link
Copy Markdown
Member Author

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

Maybe we should be more vague and not 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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland approved these changes Apr 25, 2025
View reviewed changes

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
skirpichev
skirpichev commented Apr 28, 2025
View reviewed changes

@skirpichev skirpichev left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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 integers are automatically converted to floats)?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

skirpichev added 3 commits May 8, 2025 15:26
@skirpichev
Merge branch 'master' into isnormal-subnormal/132908
a8431f7
@skirpichev
-> 3.15
dc88e9e
@skirpichev
Merge branch 'master' into isnormal-subnormal/132908
0503090
@skirpichev
skirpichev requested a review from serhiy-storchaka June 2, 2025 06:35
@skirpichev

skirpichev commented Jun 2, 2025

Copy link
Copy Markdown
Member Author

CC @serhiy-storchaka per experts index. See also issue thread.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka serhiy-storchaka changed the title gh-132908: add math.normal/subnormal() functions gh-132908: Add math.isnormal/issubnormal() functions Jun 2, 2025
serhiy-storchaka
serhiy-storchaka approved these changes Jun 2, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

skirpichev reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Modules/mathmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/math.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

skirpichev added 2 commits June 2, 2025 11:19
@skirpichev
Apply suggestions from code review
066e884
@skirpichev
address review: remove (long) casts
08f81f5
@serhiy-storchaka
serhiy-storchaka merged commit 5f61cde into python:main Jun 2, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 2, 2025
@skirpichev
skirpichev deleted the isnormal-subnormal/132908 branch June 2, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz approved these changes
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@StanFromIreland StanFromIreland StanFromIreland approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@skirpichev @picnixz @serhiy-storchaka @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — 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.