Post Reply 
Exact items for a matrix from a program
06-08-2015, 06:56 AM
Post: #2
RE: Exact items for a matrix from a program
(06-07-2015 08:07 PM)salvomic Wrote:  hi all,
there is a way to get exact results for the items of a matrix, from a Home program (non CAS program)?
For example, in my last program, if a matrix is returned it has [[1, 0.5], [0.5, 0.25]]and I would like to return also in CAS view [[1, 1/2], [1/1, ¼]] without hitting "a b/c".
Something like the nice QPI (and QPImat) program by Han (inside the program)...

I tried to use exact() but no luck for now...

Thank you
Salvo

This isn't exactly what you seek, but the STRING function has an option to convert decimals into fractions. For example:

STRING([[.1,.2],[.3,.4]],8) --> "[[1/10,1/5],[3/10,2/5]]"

The output is ugly, not "Textbook" style, but at least the fractions are there. If you want to present the result in a pretty fashion, you'd have to loop through the matrix and STRING each entry separately, I suppose.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Exact items for a matrix from a program - Joe Horn - 06-08-2015 06:56 AM



User(s) browsing this thread: 1 Guest(s)