Replies: 1 comment 1 reply
-
I think that ->NUM is becoming urgent ;-) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I observed the following behavior in matrix computations. Sharing just for discussion:
If I request the inverse of integer matrix [[1 2][2 1]], the inverse expressed with fractions is returned (looks good).
If I add a dot to make the first number a real number, as in [[1. 2][2 1]], the inverse is still returned with fractions (which surprised me at first). This seems to be a consequence of the simplification rules that are applied (I mean the fact that multiplying by 1, but also by 1.0, is treated as a no-op). This being related to the simplification rules can be confirmed by trying to invert the matrix [[2. 2][2 1]], which is returned with real numbers, not fractions. Maybe it would be nicer if the simplification rule '1*X->X' only applied when 1 is an integer, not a real number?
If I add dots to all the entries, as in [[1. 2.][2. 1.]], the inverse is returned with real numbers, as expected.
This seems to be all working as intended in the current state of the code. Maybe the surprise about the mixed types will be inconsequential as soon as there is a "->Num". On a related topic, an approximate mode, where fractions are never used, would be convenient (Would/should such a mode also prevent big integers?...).
Thanks
Camille
Beta Was this translation helpful? Give feedback.
All reactions