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 — Documentation errors in the new half-turn `*pi` functions · Issue #157135 · python/cpython

Documentation errors in the new half-turn *pi functions #157135

New issue
Copy link
New issue
Copy link
Closed
Closed
Documentation errors in the new half-turn *pi functions#157135
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@fedonman
fedonman
opened on Sep 7, 2026
Issue body actions

Bug description:

Four statements added with the half-turn functions in GH-150555 describe a different function than the one they document.

$ ./python -c 'import math; print(math.atanpi.__doc__); print(math.atanpi(-1), math.atan2pi(-1, -1), math.atanpi(-1 / -1))'
Return the arc tangent (measured in half-turns) of x.

The result is between 0 and 1.
-0.25 -0.75 0.25
  • atanpi's docstring in Modules/mathmodule.c says "The result is between 0 and 1". The range is -1/2 to 1/2, as Doc/library/math.rst states.
  • The trigonometric summary table in Doc/library/math.rst describes atan2pi(y, x) as "atan(y / x), in half-turns". atan returns radians, and the entry for the function itself says atanpi(y / x).
  • The comment above m_atanpi in Modules/mathmodule.c reads "asin(x)/pi". The function computes atan(x)/pi.
  • The comment above m_atan2pi in Modules/mathmodule.c reads "asin(x)/pi". The function computes atan2(y, x)/pi.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

  • gh-157135: Fix documentation errors in the half-turn *pi functions #157136

Activity

  1. fedonman
    changed the title [-]`math.atanpi` docstring states the wrong result range[/-] [+]Documentation errors in the new half-turn `*pi` functions[/+] on Sep 7, 2026
  2. skirpichev
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Sep 8, 2026
  3. github-project-automation
    added this to docs issueson Sep 8, 2026
  4. github-project-automation
    moved this to Todo in docs issueson Sep 8, 2026
  5. StanFromIreland
    added a commit that references this issue on Sep 8, 2026

    gh-157135: Fix documentation errors in the `math.atan{2}pi` functions (…

    7f3d7d0
  6. StanFromIreland
    closed this as completedon Sep 8, 2026
  7. maurycy
    added a commit that references this issue on Sep 10, 2026

    Merge branch 'main' into tachyon-native-callable

    e028ff5
  8. clin1234
    added a commit that references this issue on Sep 12, 2026

    pythongh-157135: Fix documentation errors in the `math.atan{2}pi` fun…

    fa348d3
  9. johnslavik
    added a commit that references this issue on Sep 14, 2026

    pythongh-157135: Fix documentation errors in the `math.atan{2}pi` fun…

    0afff53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    Projects

    • docs issues
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.