On Mon, Sep 5, 2011 at 7:41 AM, rjf <fate...@gmail.com> wrote:
> is 4^(-2)  (use various kinds of integers)  integer rational float?
> ditto for
>  5^(-2) ?
>
> Seems to me that the presence of python integers is an inconsistency
> waiting to appear, and
> the only proper use of python ints is as a sage integer which happens
> to be, at the moment,
> small in magnitude.
>  Lisp does this right, with fixnums automatically promoted to bignums
> if they get too big.

Umm... Python ints do this too. Does that mean Python gets it right?

What Python is missing is a rational type, so 5^(-2) is either
truncated or approximated in floating point. (It can be argued that
rationals are not what one wants--computing with rationals can easily
become atrociously expensive.)

Anyway, +1 to fixing this.

> Coercion from rational to integer happens if the rational has a
> denominator of 1.
>  There are lots more of these, e.g complex with imag part zero etc.
> Do you want
> these all to be equal....
> 1+0*i,  1/1, 1, int(1)?   1.0 1.0d0?  maybe.

Yes. We have a clear rule about this in Sage as delineated in the
coercion manual.

> On Sep 5, 6:52 am, Dima Pasechnik <dimp...@gmail.com> wrote:
>> this is now #11779
>
> --
> 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
>

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