Skip to content

The Python implementation of the Euclidean Algorithm by subtraction hits an infinite loop when a = 0 #740

Closed
@thecnoNSMB

Description

@thecnoNSMB

Bug Report

Description

As stated in the title. This is due to it endlessly subtracting 0 from the other number to no effect. To reproduce, call euclid_sub(0, 1) in euclidean_example.py.

Additional context

This bug was found using the Python property-based testing library Hypothesis.

For Algorithm Archive Developers

  • The bug can be reproduced
  • The bug can be fixed (if not, please explain why not in a comment below)
  • There is a timeline to fix the bug
  • The bug has been fixed (Please link the PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProblemThis is a problem in the archive or an implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions