Skip to content

modernize complex_mpfr #24489

@videlec

Description

@videlec

Similarly to #24457 for real numbers we perform some cleaning for complex numbers in view of #17713/#24457.

step 1

  • complex_field.py complex_number.pyx -> complex_mpfr.pyx #24483: move sage.rings.complex_field to sage.rings.complex_mpfr
  • change the string representation from Complex Field with XX bits of precision to Complex Floating-point Field with XX bits of precision
  • (possibly) get rid of the factory ComplexField by making the class ComplexField_class inherits from UniqueRepresentation
  • rename CompleNumber/ComplexField into ComplexFloatingPoint/ComplexFloatingPointField
  • remove the attribute _prec of ComplexNumber (a mpfr_t carries its precision that can be obtained with mpfr_get_prec)
  • deprecate is_ComplexNumber(x)/is_ComplexField(x) in favor of isinstance(x, ComplexFloatingPoint)/isinstance(x, ComplexFloatingPointField)
  • actually initialize the mpfr_t pointers in __cinit__ as it is the case for real floating point numbers in real_mpfr.pyx
  • clarify the behavior of rounding (currently there is a global (sic) variable taking care of it)
  • Deprecate CC in favor of CFF

see also task ticket #17713

Depends on #24483
Depends on #24457

CC: @mezzarobba @jpflori

Component: basic arithmetic

Author: Vincent Delecroix

Issue created by migration from https://trac.sagemath.org/ticket/24489

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