|
-
Feb 11th, 2001, 02:59 PM
#1
Thread Starter
Frenzied Member
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
-
Feb 11th, 2001, 04:11 PM
#2
Fanatic Member
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
-
Feb 11th, 2001, 04:19 PM
#3
Monday Morning Lunatic
x^2 - x - 1 = 0
This gave me an answer of:
x = 1.618033989
or
x = -0.618033988
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 12th, 2001, 08:23 PM
#4
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|