On Fri, Sep 18, 2009 at 7:13 PM, Craig Citro <craigci...@gmail.com> wrote:
>
>> I really think that floor, ceil, and round should return intervals when
>> they are fed intervals.  I thought that was the whole point of interval
>> arithmetic.    Shouldn't sin(floor(interval)) be an interval?  It won't
>> be if floor automatically converts things to integers.  Why should
>> floor, ceil, and round get special treatment to yank things out of
>> interval arithmetic?  Why not other functions too?  It seems that having
>> some functions that yank you out of interval arithmetic sort of spoil
>> everything.
>>
>
> Well, I'm a little confused -- I thought that the whole point of
> floor() and ceil() was to return Integers. Indeed:
>
> sage: x = 3.12312
> sage: type(x)
> <type 'sage.rings.real_mpfr.RealLiteral'>
> sage: type(x.floor())
> <type 'sage.rings.integer.Integer'>
> sage: x = RDF(x)
> sage: type(x.floor())
> <type 'sage.rings.integer.Integer'>
> sage: x = RealField(100)(x)
> sage: type(x.floor())
> <type 'sage.rings.integer.Integer'>
>
> So I think that this suggests returning an Integer is the right move
> -- it's just a question of what to do if there *is* no single correct
> integer.

A huge +1 to this!

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to