CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: doll parts

Search: Search took 0.06 seconds.

  1. Replies
    5
    Views
    15,528

    Re: Why am I getting -1.#IND and 1.#QNAN?

    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!
  2. Replies
    5
    Views
    15,528

    Re: Why am I getting -1.#IND and 1.#QNAN?

    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);
  3. Replies
    5
    Views
    15,528

    Re: Why am I getting -1.#IND and 1.#QNAN?

    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...
  4. Replies
    5
    Views
    15,528

    Why am I getting -1.#IND and 1.#QNAN?

    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...
  5. Replies
    3
    Views
    5,096

    Re: Secant Method problems

    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,...
  6. Replies
    3
    Views
    5,096

    Secant Method problems

    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...
  7. Thread: Error C2440

    by doll parts
    Replies
    3
    Views
    864

    Re: Error C2440

    Thank you!
  8. Thread: Error C2440

    by doll parts
    Replies
    3
    Views
    864

    Error C2440

    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];
    ...
Results 1 to 8 of 8





Click Here to Expand Forum to Full Width

Featured