Skip to content

src/sage/rings/qqbar.py: implement complex appoximations using float() - #43028

Merged
vbraun merged 3 commits into
sagemath:developfrom
orlitzky:qqbar-complex
Oct 22, 2026
Merged

vbraun merged 3 commits into
sagemath:developfrom
orlitzky:qqbar-complex

Conversation

@orlitzky

@orlitzky orlitzky commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

The __float__() method in AA was recently rewritten so that it will not approximate an exactly-zero element with a non-zero floating point. The previous implementation punted to RR() and could not make the same promise.

This PR makes the same improvement to the __complex__() and _complex_double_() methods by using the float approximation of the real and imaginary parts instead of punting to CC().

See also:

We have a more careful implementation of float() now that will not
return a non-zero approximation to an exact zero element.
The __complex__() method is now a small improvement over CC(), so use
the former to implement _complex_double_().
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Documentation preview for this PR (built with commit 7f0b2b3; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Change 0.6324555320336758j to 0.6324555320336759j, which, unarguably,
is more j.
@orlitzky
orlitzky requested a review from cxzhong October 21, 2026 03:30
@cxzhong

cxzhong commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Thank you. I will review this later

@vbraun
vbraun merged commit 6ec2119 into sagemath:develop Oct 22, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants