#20062: Make _floordiv_() for power series a deprecated alias for _div_()
-------------------------------------+-------------------------------------
Reporter: pbruin | Owner:
Type: task | Status: needs_work
Priority: minor | Milestone: sage-7.1
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: Peter Bruin | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/pbruin/20062-PowerSeries_floordiv| e9719f7399ffab100407a360c16fe0596e7f2689
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by pbruin):
Replying to [comment:2 bruno]:
> I don't fully agree with your proposal: In (generic) implementations for
elements of rings, one may need to have a `__floordiv__` (which returns
the same as `__div__`).
Why would this be necessary? If the user calls `__floordiv__`, he
presumably does this for a reason, i.e. expects that it behaves
differently from `__div__`...
> That's why (I guess) there is a `__floordiv__` in the class
`FieldElement`.
Well, power series rings are not fields. There is also an implementation
of `_floordiv_` in `RingElement`, which explicitly raises an error saying
`unsupported operand parent(s) for '//'`. In fact, this error is even
raised when applying `__floordiv__` to elements of `RR`:
{{{
sage: RR(1.2) // RR(2.3)
...
TypeError: unsupported operand parent(s) for '//': 'Real Field with 53
bits of precision' and 'Real Field with 53 bits of precision'
}}}
> So I would not deprecate it, but rather simply make it an (non-
deprecated) alias of `__div__`.
Then we should do this in general for ring elements; I don't really see
the advantage of this...
In my opinion, it would make more sense to make sure that power series
rings `R` over a field, or more generally all discrete valuation rings
`(R, v)`, are put into the category of Euclidean domains. Then floor
division in `R` can be implemented using Euclidean division, so `f // g =
f / g` if `v(g) <= v(f)` and `f // g = 0` if `v(g) > v(f)`. However, this
has the disadvantage that it is not the same as the current
`__floordiv__`, which (as far as I can see) is the same as `__div__`.
--
Ticket URL: <http://trac.sagemath.org/ticket/20062#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.