how to get rid of 'abs(x) = ' in abs return value?
Subject: how to get rid of 'abs(x) = ' in abs return value?
From: Hiisi
Date: Tue, 3 Nov 2009 22:22:02 +0300
Dear list!
I need to solve an equation and display roots only if they're less
than 1.0 by absolute value. But if I'm trying to calculate absolute
value of roots the result is string like 'abs(x) = ...' Here's an
example:
(%i1) eqn: (1 + 2*x)^3 = 13.5*(1 + x^5);
3 5
(%o1) (2 x + 1) = 13.5 (x + 1)
(%i2) soln: allroots (eqn);
(%o2) [x = .8296749902129361, x = - 1.015755543828121,
x = .9659625152196369 %i - .4069597231924075,
x = - .9659625152196369 %i - .4069597231924075, x = 1.0]
(%i3) for x in soln do if abs(x) <= 1.0 then print(abs(x));
(%o3) done
See, it's not working. So, how to obtain values of roots?
Thank you!
--
Hiisi.
Registered Linux User #487982. Be counted at: http://counter.li.org/
--
Spandex is a privilege, not a right.
--
SIP: hiisi at ekiga.net
------------------------------
pub 1024D/085B139A
--
Powered by Fedora:
http://fedoraproject.org/