I'm using this project to teach my self C++ and it mostly works but if I give is any amount of varying input it just outputs NaN and variables become monstrously large or small. I have gone thought it with Xcode breakpoint and debuged it the best I could. Some help would be great!
While {1 > 0}//While 1 is greater than 0
{
//run the inside
}
The problem here is that, 1 will always be greater than 0 so this will never cease to run.
This is something to be highly discouraged.
Your functions return 0 or 1 for true/false, but neither is used in the while loop so that loop will never exit and your program will never stop.
The solution is to have your while loop compared to a variable. So that you can exit the program.
1 2 3 4
While(RunProgram == true)
{
//run until RunProgram set to false
}
I have it to be an infinite loop because I'm testing. this is not the problem i want it to repeat hundreds of times. What I'm wanting to know is why, when it repeats, dose it tend to stop producing answers? The answers it gives is "nan".
This is a example of output information from the network.
// Console output
//this is what it should do
Calculated Result = 0.746615
DSUM = 0.047936
Wanted Result = 1.000000
//This is the problem
Calculated Result = nan
DSUM = nan
Wanted Result = 0.000000
Calculated Result = nan
DSUM = nan
Wanted Result = 0.000000
Calculated Result = nan
DSUM = nan
Wanted Result = 0.000000
Calculated Result = nan
DSUM = nan
Wanted Result = 0.000000
Calculated Result = nan
DSUM = nan
Wanted Result = 1.000000