William Stein wrote : > 2009/9/17 Jason Grout <jason-s...@creativetrax.com>: > >> Currently, round(), floor(), and ceil() on interval objects return >> intervals. >> >> There is a patch up at #2899 that changes these functions to return >> integers (round-> "round the midpoint", floor -> largest integer below >> the bottom of the interval, etc.). I think the reasoning is that >> round(), floor, ceil, etc. should always return integers. >> >> What do people think? Should we close the ticket, or should we merge >> the patch (after possible rebasing). >> >> To illustrate: >> >> Currently: >> >> sage: R = RealIntervalField(100) >> sage: a = R(9.5, 11.3); a.str(style='brackets') >> '[9.5000000000000000000000000000000 .. 11.300000000000000710542735760101]' >> sage: floor(a).str(style='brackets') >> '[9.0000000000000000000000000000000 .. 11.000000000000000000000000000000]' >> I use computation over intervals in order to see the error x in a <=> x=9.5 or x=9.56 or x=11.2 or ...
I test the function sin, the result of sin a = [-1..1] The value is 0.1 or 0.2 or -0.6 or. The a^2 operation is similar. So I prefer floor a = 9 or 10 or ... or 11, or [9..11]. Result is include in [9..11] min and max functions may be usefull if we want to get 9.5 and 11.3. F. >> >> Proposed: >> >> sage: floor(a) >> 9 >> >> > > I would find this soooooooo useful! Whenever I compute with > intervals, I often really want the integer floor, ceiling, or round. > > William > > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---