Skip to content

fmpz.__init__ could use base 0 to autodetect string type #301

Description

@d0sboots

Although it's not well-documented, fmpz_set_str supports base 0 to auto-detect based on prefix (it falls through to GMP):

  fmpz_t y;
  fmpz_init(y);
  fmpz_set_str(y, "0x64", 0);
  fmpz_print(y);
  printf("\n");
  fmpz_clear(y);
  return 0;
100

https://github.com/flintlib/python-flint/blob/main/src/flint/types/fmpz.pyx#L84

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions