You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is something very wrong with this behavior of this code, which tries to convert 1/2 to a 2x2 matrix. The problem seems not to be in the matrix code, but since it's hard to reproduce it appears in that form.
This is just due to the difference between SAGE and Python. When run from the command line or in a .sage file, SAGE will preprocess the file and change 1/2 to Integer(1)/Integer(2) to (correctly) form the rational 1/2. When included or run form a .py file, it will remain as 1/2 which Python evaluates to 0.
There is also a typo in the second section of the attached file (m1 is printed twice).
There is something very wrong with this behavior of this code, which tries to convert 1/2 to a 2x2 matrix. The problem seems not to be in the matrix code, but since it's hard to reproduce it appears in that form.
Component: basic arithmetic
Keywords: real, rational, coerce
Issue created by migration from https://trac.sagemath.org/ticket/393
The text was updated successfully, but these errors were encountered: