On Tue, Nov 17, 2009 at 01:52:58PM -0800, Simon King wrote: > Hi Alex! > > On 17 Nov., 22:12, Alex Ghitza <aghi...@gmail.com> wrote: > ... > > I'm not sure I understand this paragraph. Mathematically, 0*M is > > always the zero matrix and never the number 0. So it seems to me that > > maple screws up if it returns the number 0. > > I don't know whether maple returns the number 0. But even in Sage, > although 0*M is a matrix and not a number, this matrix is equal to the > number 0: > > sage: M = Matrix([[1,2],[3,4]]) > sage: 0*M==0 > True > sage: type(0*M) > <type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'> >
This is most likely because __cmp__ first coerces the right hand side (0) into the matrix space that the left hand side (0*M) lives in. I think that's fine, though? Alex -- Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne -- Australia -- http://www.ms.unimelb.edu.au/~aghitza/ -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org