I cannot write the whole code as it is very long. I will try to just summarise it and explain the problem.
My code is a computational code. The main program (lets call it main )calls a function(fun) from another code (lets say sub_main) using headers.
Now, in sub_main(), I have a variable given as
where some_value is calculated using the arguments passed to fun() and PI is the constant pi(3.14....).
For pi, I have used M_PI. As i was not sure what value of pi is been taken. I tried to check the output using
just before the calculating var.
Now, my output is differing in several orders of magnitude depending upon whether I put the cout statement or not.
I can't figure out why this single statement is making a huge difference. Please help.