Skip to content

random.py gammavariate(alpha, beta) recomputes constant multiple times #154984

Description

@lbaumbauer

Bug report

Bug description:

b = (_e + alpha) / _e

while True:
   # do not compute b here
    ...

. b is a constant for a given call to gammavariate(alpha, beta)

CPython versions tested on:

3.13

Operating systems tested on:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions