ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 30 Apr 2013 08:23:25 -0500A basic questionhttp://ask.sagemath.org/question/10075/a-basic-question/Hi,
I have a basic question. I don't know how to get the desired result. I am solving following problem.
var('x1','x2')
f1 = exp((2*x1+1))^2/997383793764
f2 = exp((2*x2+2)^2/8726621367521)
f = f1*f2
d = f.substitute(x1=0,x2=0)
I get an answer in the form d = e^(89324832445632473/89327467832433434646786)
How can I convert my answer (e^(89324832445632473/89327467832433434646786)) to a rational number (P/Q) that don't involve any 'e'? Sun, 28 Apr 2013 21:17:01 -0500http://ask.sagemath.org/question/10075/a-basic-question/Answer by Eviatar Bach for <p>Hi,</p>
<p>I have a basic question. I don't know how to get the desired result. I am solving following problem.</p>
<pre><code>var('x1','x2')
f1 = exp((2*x1+1))^2/997383793764
f2 = exp((2*x2+2)^2/8726621367521)
f = f1*f2
d = f.substitute(x1=0,x2=0)
</code></pre>
<p>I get an answer in the form d = e^(89324832445632473/89327467832433434646786)</p>
<p>How can I convert my answer (e^(89324832445632473/89327467832433434646786)) to a rational number (P/Q) that don't involve any 'e'? </p>
http://ask.sagemath.org/question/10075/a-basic-question/?answer=14797#post-id-14797It doesn't seem like that number is rational, so you cannot get an exact answer. However, you can get a rational that approximates it to some degree of error.
sage: RR(d).nearby_rational(max_error=1e-25)
37/4994305074310Sun, 28 Apr 2013 21:55:12 -0500http://ask.sagemath.org/question/10075/a-basic-question/?answer=14797#post-id-14797Answer by assadabbasi for <p>Hi,</p>
<p>I have a basic question. I don't know how to get the desired result. I am solving following problem.</p>
<pre><code>var('x1','x2')
f1 = exp((2*x1+1))^2/997383793764
f2 = exp((2*x2+2)^2/8726621367521)
f = f1*f2
d = f.substitute(x1=0,x2=0)
</code></pre>
<p>I get an answer in the form d = e^(89324832445632473/89327467832433434646786)</p>
<p>How can I convert my answer (e^(89324832445632473/89327467832433434646786)) to a rational number (P/Q) that don't involve any 'e'? </p>
http://ask.sagemath.org/question/10075/a-basic-question/?answer=14828#post-id-14828Thank You @Eviatar BachSun, 28 Apr 2013 22:40:53 -0500http://ask.sagemath.org/question/10075/a-basic-question/?answer=14828#post-id-14828Comment by Eviatar Bach for <p>Thank You <a href="/users/189/eviatar-bach/">@Eviatar Bach</a></p>
http://ask.sagemath.org/question/10075/a-basic-question/?comment=17783#post-id-17783No problem!Tue, 30 Apr 2013 08:23:25 -0500http://ask.sagemath.org/question/10075/a-basic-question/?comment=17783#post-id-17783