I am new to programming and trying to write a new program. While checking through my program it is returning the error code 1.#QNAN. I have tried isolating the variable an
1#QNAN is a string representation for a "quiet NAN". A "NAN" is "not-a-number" and applies only to floats and doubles.
NANs can be very useful actually for representing "null" values (rather than picking some genuine number and hoping for the best you don't need that number for its natural meaning).
Some mathematical operations can return a NAN if the operation is "not valid" (eg taking the log of a negative number).
You can generate a QNAN from C++ using
double d = std::numeric_limits::quiet_NaN();
Any comparison operation (==, <= etc) on a NAN returns false, even comparing its equality to itself, except for != which always returns true (even when comparing to itself).
(The actual bug in your code appears to be a function that returns double but has no return statement).