ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 15 Sep 2013 05:29:57 -0500Decimal to fraction?http://ask.sagemath.org/question/10540/decimal-to-fraction/I did .1/8, and the output was 0.0125000000. Is there a way to get it to display as 1/80.bxdinSun, 15 Sep 2013 05:29:57 -0500http://ask.sagemath.org/question/10540/Display decimal as a fraction?http://ask.sagemath.org/question/10301/display-decimal-as-a-fraction/The number 1.5 represents 3/2 in decimal form.
In sage I can get 3/2 to display as a decimal: 3/2.n()
I haven't had any luck converting 1.5 to a fraction.bxdinSun, 30 Jun 2013 13:32:27 -0500http://ask.sagemath.org/question/10301/Get a matrix to display answers as decimals/floats, not fraction?http://ask.sagemath.org/question/10294/get-a-matrix-to-display-answers-as-decimalsfloats-not-fraction/I searched and couldn't find a viable solution:
I successfully executed the following:
<pre>
ma = matrix([[25, 5, 1], [49, 7, 1], [81, 9, 1]])
mb = matrix([[1121], [626], [967]])
show(ma)
show(mb)
ms = ma^-1 * mb
show(ms)
</pre>
Unfotunately though, the statement, show(ms), displays the answer/values as fractions, meaning I have to manually enter each of the value 3 separate times, as part of a float function, i.e., float(fraction/number).
How can I force show(ms), to display the values as decimals?
Also I find the matrix more readable/writable if I can enter each row's values by their own line, instead of the same line, as seen on the the, ma= & mb= statements. I remember I could this with ease in MatLab. I'd appreciate knowing how to that as well.
This post also has an unanswered question if anyone is up for the challenge, :P, j/k:
http://ask.sagemath.org/question/2732/display-y-intercept
bxdinSat, 29 Jun 2013 01:07:37 -0500http://ask.sagemath.org/question/10294/