On Thu, Mar 7, 2019 at 2:24 PM Simon King <simon.k...@uni-jena.de> wrote: > > Hi Erik, > > On 2019-03-06, E. Madison Bray <erik.m.b...@gmail.com> wrote: > > and also Python 2 always rounds half-integers up, whereas > > Python 3 rounds even half-integers down and odd half-integers up. > > What the heck?? Is there any widely accepted industry standard for that > "odd" rule? Why not round down half-integers whose cross total in > hexagesimal representation has an odd number of prime divisors, and > round up otherwise? </sarcasm>
This is completely normal: https://en.wikipedia.org/wiki/Rounding#Round_half_to_even > > On Python 3, when giving a non-zero argument for the second > > argument--rounding to a decimal place--it always returns a float. > > > > Also on Python 3, an object a type that implements __round__ can > > return any type it wants for round(obj). > > If I understand correctly, Sage currently uses .round() for customised > rounding. Would it be a good idea to add a .__round__() method to > sage.structure.element.Element that by default tries to return > self.round()? No, I don't think that would be useful--I don't think that really solves any problem here or answers any of my questions, sorry. If no one knows or can give a clear answer maybe I'll just do whatever makes sense to me, and then absolve any responsibility if someone complains later. Because I'm saying right now that I don't know what the right thing to do here is, and if no one else knows either I'll just have to make my best guess... -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.