Skip to content

__floordiv__ should be part of coercion model #2034

@malb

Description

@malb

Add __floordiv__ to the coercion model for RingElement and change __floordiv__ to _floordiv_ where applicable.

This does not change any semantics of floor division, but it does fix floor division in a few cases where coercion is involved. It also fixes various segmentation faults like

sage: R.<x> = QQbar[]
sage: int(1) // x
...

Finally, we also implement __itruediv__, which was forgotten when adding __truediv__.

Component: coercion

Author: Jeroen Demeyer

Branch/Commit: 3e0e5b8

Reviewer: Vincent Delecroix

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions