October 28th, 2008, 11:40 PM
That would be the case, my base is negative. So, if x is negative, I can change pow(x, 1.0/3.0) to -pow(-x, 1.0/3.0) and that should correct my problem. Thank you so much!
October 28th, 2008, 11:31 PM
I just wrote r that way in my post, though, in my code I have r = pow((-0.5*g)+sqrt(h), 1.0/3.0);
October 28th, 2008, 11:05 PM
I am honestly not sure; I just started using C++ about a month and a half ago, and that line was from a program my professor had given us that found only the real roots of a cubic.
I did the...
October 28th, 2008, 10:17 PM
Hello,
I've written a program to find exact roots to a cubic equation (be they real or complex), and in the case where there is one real and two complex conjugate roots, I occasionally get the...
October 13th, 2008, 08:41 PM
I never would have caught that semi-colon.
This is what I have now, and it seems to work. Thanks!
#include <iostream>
#include <math.h>
using namespace std;
double x0, x1, x, N = 2.0,...
October 13th, 2008, 07:51 PM
I'm trying to implement the secant method, but I'm having a problem. No matter the function or the initial guesses I use, I get the output "The solution is 0 and it was found in 2 iterations." I...
October 5th, 2008, 03:20 AM
October 4th, 2008, 11:54 AM
Hello, I am new to C++ and, I am attempting to fix the following program block:
#include <iostream>
using namespace std;
int [3] myFunction (int aI) {
int a[3];
...