-
Hey,
Ok, i have got the equation:
(((X * X) - X) - 1) = 0
"X Squared, Minus X, Minus 1"
What i have to do is work out what x is to make 0 so say 3*3 - 3 - 1 etc. Does anyone know the answer or an program that will work out the answer. I have this:
#include <iostream.h>
void main (void)
{
float cur;
float x;
char *temp;
cur = 0.0;
do
{
cur = cur + 0.0000000000000000000000000000000000000001;
x = (((cur * cur) - cur) - 1);
cout << cur << "\t" << x << endl;
}while (x != 0);
cin >> temp;
}
but im not sure if thats working properly. It can be in vb or c++ but i just need to find what valuse X has to be so that X squared, minus X, minus 1 is equal to 0.
Thanks
-
Why can't you use the formula:
(-b(+or-) (srqt(b*b) - 4ac)) / 2a
where aX*X + bX + c = 0
the equation may be better writen as:
-b±sqrt((b*b-4ac))
------------------------
2a
Need more info?
Rob
-
x^2 - x - 1 = 0
This gave me an answer of:
x = 1.618033989
or
x = -0.618033988
-
2nd degree equation
A 2nd degree equation always return 2 results... you have to discard one of those results (or both) depending on the application of that equation...
Example: If you are working just with natural numbers... then the negative result must be discarded.
If you have none of those restrictions... then both results satisfy the equation
Regards
Rodrigo F. Uranga