In programming contests, floating point arithmetic related questions say "the error is answer must be less than 1e-6" or "The answer must be correct upto 6 decimal places". Does this mean that I can perform calculations on FP variables without worrying about the precision and only while printing I should write like
printf("%.6lf",a);
Am I understanding it correctly? And do the above 2 quotes mean the same thing? In one of the questions, when I used a double array and performed some calculations and printed one of the array elements. It printed "-0.000000". What does this mean? But when I used vectors in C++ like
vector<double> arr(10,0.0);
the same calculations printed "0.000000". Why there is such difference?