i have double variable that is assigned the value of a function.
I cerr the variable with 20 precision and it gives
2.000000000000... then I compare it with another variable that is equal to 2.00 and the if statement x==y doesnt execute. insted the else statement executes.
just to test, in the else statemnt I put cerr << x << " "<< y;
and it gives 2.00000 2.00000
what could be the problem.
it executes the statment if x<2.00
please help. that's truly STRANGE.
probably it's something simple but I don't get it.
thank you. Avendeval
I cerr the variable with 20 precision and it gives
2.000000000000... then I compare it with another variable that is equal to 2.00 and the if statement x==y doesnt execute. insted the else statement executes.
just to test, in the else statemnt I put cerr << x << " "<< y;
and it gives 2.00000 2.00000
what could be the problem.
it executes the statment if x<2.00
please help. that's truly STRANGE.
probably it's something simple but I don't get it.
thank you. Avendeval