René's URL Explorer Experiment


Title: Decide the fate of missing C99 functions in `math` · Issue #135853 · python/cpython · GitHub

Open Graph Title: Decide the fate of missing C99 functions in `math` · Issue #135853 · python/cpython

X Title: Decide the fate of missing C99 functions in `math` · Issue #135853 · python/cpython

Description: Feature or enhancement Proposal: I will first post here because I don't want to flood DPO with a controversial thread. I didn't dig much in the issues so it might have already been discussed a bit more in detail elsewhere. There are some...

Open Graph Description: Feature or enhancement Proposal: I will first post here because I don't want to flood DPO with a controversial thread. I didn't dig much in the issues so it might have already been discussed a bit ...

X Description: Feature or enhancement Proposal: I will first post here because I don't want to flood DPO with a controversial thread. I didn't dig much in the issues so it might have already been discusse...

Opengraph URL: https://github.com/python/cpython/issues/135853

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Decide the fate of missing C99 functions in `math`","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nI will first post here because I don't want to flood DPO with a controversial thread. I didn't dig much in the issues so it might have already been discussed a bit more in detail elsewhere.\n\nThere are some functions in `math.h` that we don't export in `math` as some are useless for Python or just forgotten. We recently added `isnormal` and `issubnormal` but the following are missing:\n\n#### [`scalbn`](https://www.cppreference.com/w/c/numeric/math/scalbn.html)\n\nIt's only useful if FLT_RADIX != 2. Python only supports FLT_RADIX = 2 or 16 but I don't know how many systems have FLT_RADIX = 16. So I don't think we need it for now. [`logb`](https://www.cppreference.com/w/c/numeric/math/logb.html) also depends on FLT_RADIX but I think we can ignore it if we don't add `scalbn`.\n\n**DECISION**: let's not add it as numpy doesn't have it and it has a confusing name (at least to me).\n\n#### [`fdim`](https://www.cppreference.com/w/c/numeric/math/fdim.html)\n\nThis one could be useful to handle possible signed zeros when doing fp artihmetic. Similarly, `math` currently lacks `fmax` and `fmin` which could useful if we support IEC 60559 because `max(nan, inf) == nan` and `max(inf, nan) == inf` which is incorrect (in both cases `fmax` would have returned `inf` on such systems).\n\n**DECISION**: numpy has `fmax` and `fmin` and treat the NaNs correctly, but not `fdim`. For now, let's not add it.\n\n#### [`remquo`](https://www.cppreference.com/w/c/numeric/math/remquo.html)\n\nThis one is useful for implementing $t$-periodic functions for $t$ exactly representable as an fp-value. I don't know if users are expected to actually work in Python for such functions, but I think we can expose it.\n\n**DECISION**: numpy doesn't have it and while it could be fine, it's actually really niche.\n\n#### [`fpclassify`](https://www.cppreference.com/w/c/numeric/math/fpclassify.html)\n\nNow that we have normal and subnormal detection, I suggest we also add this function. This would however require new constants which may or may not be adequate as this would make the module a bit heavier. It was asked in https://github.com/python/cpython/issues/132908#issuecomment-2834032127 but we didn't follow up with that later.\n\n**DECISION**: I would personally like it but it would more for completeness rather than usefulness, and numpy doesn't have it so I won't push for it.\n\n#### [`isunordered`](https://www.cppreference.com/w/c/numeric/math/isunordered.html)\n\nCan be useful to detect if either operand is a NaN. It can save some `math.isnan(x) or math.isnan(y)` expression.\n\n**DECISION**: it is useful but a better named helper in pure Python would do the job.\n\n#### [`signbit`](https://en.cppreference.com/w/c/numeric/math/signbit) \n\nUseful for getting the sign of signed zeroes, infinities and NaN.\n\n**DECISION**: I was wrong in my original statement as Mark pointed out but this one seems the most useful. So I'll work on it tomorrow.\n\n-----\n\nI omitted some functions such as `isless` as they are directly implemented in Python and I don't think we should do something here. I also omitted rounding functions that depend on the rounding mode as those should be handled by `Decimal` instead. \n\nFinally, it's unfortunate that we named `math.gamma` instead of `math.tgamma` as `math.gamma` could have been confused with Euler-Mascheroni's constant. \n\ncc @skirpichev @tim-one \n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-135877\n* gh-135888\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/picnixz","@type":"Person","name":"picnixz"},"datePublished":"2025-06-23T13:36:07Z","url":"https://github.com/python/cpython/issues/135853"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:30004c53-f1c5-090e-7b90-1c71032839b4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB42C:215B92:34FCD0F:469184E:6B020285
html-safe-nonce9b512fbf8629ea46e9c85ede0f918606aa67cdf6d6d5f9ded1361cc83b635c13
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDJDOjIxNUI5MjozNEZDRDBGOjQ2OTE4NEU6NkIwMjAyODUiLCJ2aXNpdG9yX2lkIjoiNjkyOTU1NTA2MjQxOTIyNzI2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfbe57c8faf412099e5d141b9d87f79930d94a999345502df8873cfbfadc85688
hovercard-subject-tagissue:3168239691
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/135853/issue_layout
twitter:imagehttps://opengraph.githubassets.com/923dce8520c9c38aeaa453efe7700fbf7c040bb5bc46fc1e7ab1c0981437ccd4/python/cpython/issues/135853
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/923dce8520c9c38aeaa453efe7700fbf7c040bb5bc46fc1e7ab1c0981437ccd4/python/cpython/issues/135853
og:image:altFeature or enhancement Proposal: I will first post here because I don't want to flood DPO with a controversial thread. I didn't dig much in the issues so it might have already been discussed a bit ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepicnixz
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/135853#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F135853
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F135853
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/135853
Reloadhttps://github.com/python/cpython/issues/135853
Reloadhttps://github.com/python/cpython/issues/135853
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/135853
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/135853
Decide the fate of missing C99 functions in mathhttps://github.com/python/cpython/issues/135853#top
https://github.com/picnixz
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Jun 23, 2025https://github.com/python/cpython/issues/135853#issue-3168239691
scalbnhttps://www.cppreference.com/w/c/numeric/math/scalbn.html
logbhttps://www.cppreference.com/w/c/numeric/math/logb.html
fdimhttps://www.cppreference.com/w/c/numeric/math/fdim.html
remquohttps://www.cppreference.com/w/c/numeric/math/remquo.html
fpclassifyhttps://www.cppreference.com/w/c/numeric/math/fpclassify.html
#132908 (comment)https://github.com/python/cpython/issues/132908#issuecomment-2834032127
isunorderedhttps://www.cppreference.com/w/c/numeric/math/isunordered.html
signbithttps://en.cppreference.com/w/c/numeric/math/signbit
@skirpichevhttps://github.com/skirpichev
@tim-onehttps://github.com/tim-one
gh-135853: add math.signbit #135877https://github.com/python/cpython/pull/135877
gh-135853: add math.fmax and math.fmin #135888https://github.com/python/cpython/pull/135888
picnixzhttps://github.com/picnixz
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
on Jun 23, 2025https://github.com/python/cpython/issues/135853#event-18274062049
https://github.com/mdickinson
mdickinsonhttps://github.com/mdickinson
on Jun 23, 2025https://github.com/python/cpython/issues/135853#issuecomment-2997028552
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Jun 23, 2025https://github.com/python/cpython/issues/135853#issuecomment-2997095483
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Jun 23, 2025https://github.com/python/cpython/issues/135853#issuecomment-2997098798
https://github.com/rhettinger
rhettingerhttps://github.com/rhettinger
on Jun 23, 2025https://github.com/python/cpython/issues/135853#issuecomment-2997169720
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Jun 23, 2025https://github.com/python/cpython/issues/135853#issuecomment-2997209275
numpy.signbithttps://numpy.org/doc/stable/reference/generated/numpy.signbit.html
picnixzhttps://github.com/picnixz
on Jun 23, 2025https://github.com/python/cpython/issues/135853#event-18277684875
https://github.com/skirpichev
skirpichevhttps://github.com/skirpichev
on Jun 23, 2025https://github.com/python/cpython/issues/135853#issuecomment-2997315685
#133895https://github.com/python/cpython/issues/133895
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Jun 23, 2025https://github.com/python/cpython/issues/135853#issuecomment-2997327663
picnixzhttps://github.com/picnixz
on Jun 28, 2025https://github.com/python/cpython/issues/135853#event-18368553278
gh-135853: add `math.signbit` (#135877)https://github.com/python/cpython/commit/42ccac2d7f29f6befed46ca7a131de82901dcbcf
gh-135853https://github.com/python/cpython/issues/135853
#135877https://github.com/python/cpython/pull/135877
42ccac2https://github.com/python/cpython/commit/42ccac2d7f29f6befed46ca7a131de82901dcbcf
AndPuQinghttps://github.com/AndPuQing
on Jul 11, 2025https://github.com/python/cpython/issues/135853#event-18584721347
pythongh-135853: add `math.signbit` (python#135877)https://github.com/AndPuQing/cpython/commit/820d7fc7d0eaabb2d586ac389fc0c5ac4e1ab436
pythongh-135853https://github.com/python/cpython/issues/135853
python#135877https://github.com/python/cpython/pull/135877
820d7fchttps://github.com/AndPuQing/cpython/commit/820d7fc7d0eaabb2d586ac389fc0c5ac4e1ab436
picnixzhttps://github.com/picnixz
on Jul 12, 2025https://github.com/python/cpython/issues/135853#event-18599090880
gh-135853: add `math.fmax` and `math.fmin` (#135888)https://github.com/python/cpython/commit/2301cdb5596ebc8ded56b948c92c1f5fd29ba92a
gh-135853https://github.com/python/cpython/issues/135853
#135888https://github.com/python/cpython/pull/135888
2301cdbhttps://github.com/python/cpython/commit/2301cdb5596ebc8ded56b948c92c1f5fd29ba92a
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Jul 12, 2025https://github.com/python/cpython/issues/135853#issuecomment-3065141361
picnixzhttps://github.com/picnixz
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 12, 2025https://github.com/python/cpython/issues/135853#event-18599250383
Pranjal095https://github.com/Pranjal095
on Jul 12, 2025https://github.com/python/cpython/issues/135853#event-18600182536
pythongh-135853: add `math.signbit` (python#135877)https://github.com/Pranjal095/cpython/commit/6a1475ed06661d44e923e440441f3f0908655030
pythongh-135853https://github.com/python/cpython/issues/135853
python#135877https://github.com/python/cpython/pull/135877
6a1475ehttps://github.com/Pranjal095/cpython/commit/6a1475ed06661d44e923e440441f3f0908655030
pythongh-135853: add `math.fmax` and `math.fmin` (python#135888)https://github.com/Pranjal095/cpython/commit/b2a5ad4959260b458e393f199b7c00e27448e0f5
pythongh-135853https://github.com/python/cpython/issues/135853
python#135888https://github.com/python/cpython/pull/135888
b2a5ad4https://github.com/Pranjal095/cpython/commit/b2a5ad4959260b458e393f199b7c00e27448e0f5
picnixzhttps://github.com/picnixz
on Jul 13, 2025https://github.com/python/cpython/issues/135853#event-18605019967
pythongh-135853: add `math.fmax` and `math.fmin` (python#135888)https://github.com/picnixz/cpython/commit/ab56fe6aff324c95bd7d64e08c411a31e438ca8e
pythongh-135853https://github.com/python/cpython/issues/135853
python#135888https://github.com/python/cpython/pull/135888
ab56fe6https://github.com/picnixz/cpython/commit/ab56fe6aff324c95bd7d64e08c411a31e438ca8e
taegyunkimhttps://github.com/taegyunkim
on Aug 4, 2025https://github.com/python/cpython/issues/135853#event-18976844384
pythongh-135853: add `math.signbit` (python#135877)https://github.com/taegyunkim/cpython/commit/dacdd60a2fc33187d07442ce0911ee699a72f2c4
pythongh-135853https://github.com/python/cpython/issues/135853
python#135877https://github.com/python/cpython/pull/135877
dacdd60https://github.com/taegyunkim/cpython/commit/dacdd60a2fc33187d07442ce0911ee699a72f2c4
pythongh-135853: add `math.fmax` and `math.fmin` (python#135888)https://github.com/taegyunkim/cpython/commit/8f140d28bd15417416668611ed8cc441bf285bfa
pythongh-135853https://github.com/python/cpython/issues/135853
python#135888https://github.com/python/cpython/pull/135888
8f140d2https://github.com/taegyunkim/cpython/commit/8f140d28bd15417416668611ed8cc441bf285bfa
Agent-Hellboyhttps://github.com/Agent-Hellboy
on Aug 19, 2025https://github.com/python/cpython/issues/135853#event-19221803998
pythongh-135853: add `math.signbit` (python#135877)https://github.com/Agent-Hellboy/cpython/commit/7050d27548a81856e2891b1c8f3ceefb516343cd
pythongh-135853https://github.com/python/cpython/issues/135853
python#135877https://github.com/python/cpython/pull/135877
7050d27https://github.com/Agent-Hellboy/cpython/commit/7050d27548a81856e2891b1c8f3ceefb516343cd
pythongh-135853: add `math.fmax` and `math.fmin` (python#135888)https://github.com/Agent-Hellboy/cpython/commit/4694ff6c6ec2d4334c09a8d05bc76b8ec1c95f4c
pythongh-135853https://github.com/python/cpython/issues/135853
python#135888https://github.com/python/cpython/pull/135888
4694ff6https://github.com/Agent-Hellboy/cpython/commit/4694ff6c6ec2d4334c09a8d05bc76b8ec1c95f4c
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/135853
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/135853
picnixzhttps://github.com/picnixz
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.