Skip to content

fmpq_inv may return 1/0, fmpq_set_str returns in non-canonical form #2489

@mozhewen

Description

@mozhewen

Describe the bug
fmpq_inv of zero returns 1/0.
fmpq_set_str only converts the str literally. For example, "4/6" -> 4/6.

Steps to reproduce

Expected behavior
fmpq_inv may throw a "Division by zero" exception, consistent with fmpq_div.
Not sure if the behavior of fmpq_set_str is intended.

System (please complete the following information):

  • System CPU: MacBook Pro Apple M1 Pro
  • Version of FLINT (if using Git, please specify commit): 3.3.1
  • How FLINT was configured (i.e. options pushed): Installed from homebrew
  • Output of configure Default configurations
    Insert here
    

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions